Not sure what the best response is here, but an autoload within a hook_init tends to cause Drush to die as the path isn't set correctly.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikey_p’s picture

Actually I think this may be a Drush problem:

PHP Fatal error:  require(): Failed opening required '/Users/mdp/bin/drush/sites/all/modules/analytics/includes/analytic.inc' (include_path='.:/usr/share/PEAR') in /Users/mdp/www/analytics/sites/all/modules/autoload/autoload.module on line 33

Leaving it here for input though.

Steven Merrill’s picture

FileSize
971 bytes

Here's a patch to make autoload HEAD work with Drush by checking to see if it's being invoked from the PHP CLI.

Crell’s picture

Status: Active » Needs work

HEAD is vestigial. Can you roll a patch against the 6--1 branch, and include comments of what you're actually doing and why? I don't really get it. :-)

kehan’s picture

subscribing

kehan’s picture

Status: Needs work » Needs review
FileSize
1.72 KB

I've rerolled the patch against 6--1 and drush commands work again - I tried to add comments - let me know if anything is unclear and I'll try to work it out.
Cheers,
Kehan

mikey_p’s picture

I don't have time to test this right not, but the approach looks sound.

SimmeLj’s picture

FileSize
665 bytes

Why not use realpath() instead and make it work in both Drush and "normal mode" with just on line of code?

moshe weitzman’s picture

this code does use realpath()

Robin van Emden’s picture

Crell’s picture

Status: Needs review » Fixed

I've committed the patch in #7. I'm not releasing a stable, though, until I get more feedback about it. Someone please try the new dev tarball as I've just committed a bunch of stuff. :-)

Status: Fixed » Closed (fixed)

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