At the minute we currently load manually and before any other drupal file. This can cause issues if anything in relies on

As an example see catch's backport of cache array for pressflow 6.x [1], the CacheArrayObject if defined in and the schema implementation lives in When trying to use drush with it, drush will error out with a fatal error complaining about CacheArrayObject not being defined. is included in line 685 of includes/ [2]. It was introduced in commit 109b88fe43616ca0cf6c3e7f64dc884ed72a791b [3] by #1133284: separate functional from unit tests. It looks like the inclusion may have been a mistake. DRUSH_DRUPAL_SIGNATURE replaced DRUSH_DRUPAL_BOOTSTRAP which was actually being used for two purposes: to test if we're currently in a drupal directory and to bootstrap the site. The commit changed the file we look for to determine if we're in a drupal directory to and renamed the definition but it also kept the include (which now points to the wrong file). The inclusion of the bootstrap file is now handled by drush_drupal_version() [4].

I suggest just removing the include line as it doesn't seem to serve a purpose. I'll attach a patch in the first reply.

I tried running the included phpunit tests before and after the change. There didn't seem to be any change in the results (although there were failures both times).

The change will result in the drush bootstrap change when is available changing from DRUSH_BOOTSTRAP_DRUPAL_ROOT to DRUSH_BOOTSTRAP_DRUPAL_FULL. This didn't seem to cause any issues with any of the commands I tested. If it does result in an issue it may be better for the command to change it's bootstrap level or to manually load itself. If nothing else, discovering these commands will help us to document the reasons why drush includes early.



Dean Reilly’s picture

Status:Active» Needs review
new427 bytes

Patch attached.

moshe weitzman’s picture

Status:Needs review» Patch (to be ported)

Thanks for the excellent bug report. I think you are correct, so I've committed this to 6.x. It did not apply cleanly to 5.x

Dean Reilly’s picture

Version:8.x-6.x-dev» 7.x-5.x-dev
Status:Patch (to be ported)» Needs review
new551 bytes

Cheers, moshe. Here's the patch for 5.x

moshe weitzman’s picture

Version:7.x-5.x-dev» 8.x-6.x-dev
Status:Needs review» Fixed

Committed. Thanks.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary:View changes

Fixing up grammar.