As in question. I know that I can use drush command, but I have small script and I don't want to create module from it. Now I calling that script inside main Drupal folder (no multisites).
Inside that script I just bootstraping Drupal (I need Access to Drupal API):
define('DRUPAL_ROOT', getcwd()); require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); #db integration
(The same PHP header I use for e.g unit tests class)
It is possible to run such script in multisite enviromnent too?
My problem is that every sites config settings.php has db name called 'default'. So I don't know how to use db_set_active properly.
I have script that creating data (txt file) for Menu Import module. I need access to Drupal and Joomla db, because I need to migrate menu from Joomla.
Anyway here is a script
DRUPAL_ROOTis probably not set yet, unless you have included a file above that row.
SHOW DATABASES LIKE '%drupal%'to get the relevant ones.