How to modify template.php in bootstrap theme, to add a class tag to menu li tag? I am using Drupal 7 with the Bootstrap theme and a customised subtheme.

I would like to modify template.php to add a class for each &lt;li&gt; in the menu. As per instructions provided in:
https://drupal.org/comment/5830446#comment-5830446 

Instructions say:


  "...use this snippet in template.php to put a unique id for &lt;a&gt; and &lt;li&gt; elements at the same time"


&lt;?php
/**
* theme_menu_link()
*/
function MYSUBTHEME_menu_link(array $variables) {
//add class for li
   $variables['element']['#attributes']['class'][] = 'menu-' . $variables['element']['#original_link']['mlid'];
//add class for a
   $variables['element']['#localized_options']['attributes']['class'][] = 'menu-' . $variables['element']['#original_link']['mlid'];
//dvm($variables['element']);
  return theme_menu_link($variables);
}
?&gt;


Which template.php file should I modify? and how? I have the following template.php available:


./bootstrapMYSUBTHEME/template.php
./bootstrapMYSUBTHEME/templates/template.php
./bootstrap/template.php
./bootstrap/bootstrap_subtheme/template.php
Whenever in a theming guide you see a reference to template.php without a context, it should (and in official documentation does) mean the template.php in the root directory of a theme / subtheme you are developing.

In your case it means ./bootstrapMYSUBTHEME/template.php

Never hack your base theme. Your changes will be lost and gone if someone will decide to upgrade it. And if you will upgrade it, you will have to re-write them into new version after each upgrade. Waste of time, subthemes are there exactly to avoid that burden.