I think it's fairly common to use site/all/modules/contrib/ for contributed modules, so I suggest adding the following when looking for bootstrap.inc.

if (file_exists('../../../../../includes/bootstrap.inc')) {
  // If this script is in the (drupal-root)/sites/(site)/modules/contrib/pubdlcnt directory
  chdir('../../../../../'); // go to drupal root
}

Comments

sreynen’s picture

Status: Active » Reviewed & tested by the community

I've implemented this and it solved my problem. /sites/all/modules/contrib is a de-facto standard place to put contrib modules. Drush supports it.

dsdeiz’s picture

Dunno if it's worth but there's DRUPAL_ROOT.

ndf’s picture

Issue summary: View changes
StatusFileSize
new739 bytes

And a patch file here.

ndf’s picture

ndf’s picture