The code in hook_boot should not be run when drush is being used. It screws things up with errors like this:

PHP Fatal error:  Uncaught exception 'WURFL_Storage_Exception' with message 'The file cache directory is not writeable: sites/example.net/libraries/wurfl/resources/../cache' in /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php:53
Stack trace:
#0 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(42): WURFL_Storage_File->createCacheDirIfNotExist()
#1 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(37): WURFL_Storage_File->initialize(Array)
#2 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/Factory.php(43): WURFL_Storage_File->__construct(Array)
#3 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(142): WURFL_Storage_Factory::create(Array)
#4 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(57): WURFL_WURFLManagerFactory::persistenceStorage(Array)
#5 /var/www/example.net.live/sites/example.net/modules/contrib/wurfl/wurfl.modu in /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php on line 53
Drush command terminated abnormally due to an unrecoverable error.                                                                                                      [error]
Error: Uncaught exception 'WURFL_Storage_Exception' with message 'The file cache directory is not writeable: sites/example.net/libraries/wurfl/resources/../cache' in
/var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php:53
Stack trace:
#0 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(42): WURFL_Storage_File->createCacheDirIfNotExist()
#1 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(37): WURFL_Storage_File->initialize(Array)
#2 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/Factory.php(43): WURFL_Storage_File->__construct(Array)
#3 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(142): WURFL_Storage_Factory::create(Array)
#4 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(57): WURFL_WURFLManagerFactory::persistenceStorage(Array)
#5 /var/www/example.net.live/sites/example.net/modules/contrib/wurfl/wurfl.modu in /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php,
line 53

Fatal error: Uncaught exception 'WURFL_Storage_Exception' with message 'The file cache directory is not writeable: sites/example.net/libraries/wurfl/resources/../cache' in /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php:53
Stack trace:
#0 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(42): WURFL_Storage_File->createCacheDirIfNotExist()
#1 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php(37): WURFL_Storage_File->initialize(Array)
#2 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/Factory.php(43): WURFL_Storage_File->__construct(Array)
#3 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(142): WURFL_Storage_Factory::create(Array)
#4 /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/WURFLManagerFactory.php(57): WURFL_WURFLManagerFactory::persistenceStorage(Array)
#5 /var/www/example.net.live/sites/example.net/modules/contrib/wurfl/wurfl.modu in /var/www/example.net.live/sites/example.net/libraries/wurfl/WURFL/Storage/File.php on line 53

I believe it's because the paths that are being passed through to wurfl are relative to the web root, and not absolute filesystem paths. In any case, I don't see any need for this stuff to be initialized in hook_boot when drush commands are being run. Mobile Tools doesn't initialises itself when being called from drush. The following patch resolves.

CommentFileSizeAuthor
#1 1313040.1-wurfl-drush.patch605 bytesmrfelton

Comments

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new605 bytes