backdrop-contrib / backdrop-drush-extension

A set of commands and boot class for Drush and Backdrop CMS.
GNU General Public License v2.0
14 stars 18 forks source link

Check if backdrop drush extension works with MAMP? #85

Closed serundeputy closed 5 years ago

serundeputy commented 7 years ago

Reporeted by @cellear in gitter:

Hmm. Well, for better or worse I actually stumbled slightly forward. I seem to have a fresh install of drush, that works with D7:
   [Sun Feb 12 11:35 PM] ~/Sites/MAMP/d7
   luke@lukes-MacBook-Pro$ which drush
   /Users/luke/bin/drush

   [Sun Feb 12 11:35 PM] ~/Sites/MAMP/d7
   luke@lukes-MacBook-Pro$ drush status | grep version
   Drupal version                  :  7.55-dev                                          
   Drush version                   :  8.1.9
But it doesn't "see" backdrop when in a backdrop dir:
[Sun Feb 12 11:37 PM] ~/Sites/MAMP/backdrop2/www
luke@lukes-MacBook-Pro$ drush status 
 PHP configuration      :  /Applications/MAMP/bin/php/php5.6.27/conf/php.ini 
 PHP OS                 :  Darwin                                            
 Drush script           :  /Users/luke/bin/drush                             
 Drush version          :  8.1.9                                             
 Drush temp directory   :  /tmp                                              
 Drush configuration    :                                                    
 Drush alias files      :

Luke McCormick @cellear 02:46
I have the backdrop commands expanded into my ~/.drush directory:
[Sun Feb 12 11:44 PM] ~/.drush
luke@lukes-MacBook-Pro$ ls -R commands
1.x-0.x.zip        backdrop        backdrop_core.drush.inc    pm            user

commands/backdrop:
drush-1.x-0.x

commands/backdrop/drush-1.x-0.x:
BackdropBoot.php    README.md        commands        includes
LICENSE.txt        backdrop.drush.inc    grn

commands/backdrop/drush-1.x-0.x/commands:
backdrop_core.drush.inc    pm            user

commands/backdrop/drush-1.x-0.x/commands/pm:
backdrop_pm.drush.inc

commands/backdrop/drush-1.x-0.x/commands/user:
backdrop_user.drush.inc            backdrop_user_password.drush.inc

commands/backdrop/drush-1.x-0.x/grn:
README.md    grn.api.php    grn.drush.inc

commands/backdrop/drush-1.x-0.x/includes:
batch.inc    environment.inc    install.inc    update.inc

commands/pm:
backdrop_pm.drush.inc

commands/user:
backdrop_user.drush.inc            backdrop_user_password.drush.inc
But they don't seem to register:
[Sun Feb 12 11:46 PM] ~/Sites/MAMP/backdrop2/www
luke@lukes-MacBook-Pro$ drush pm-update
The external command could not be executed due to an application error.                                                                    [error]
pm-updatestatus failed.                                                                                                                    [error]

[Sun Feb 12 11:46 PM] ~/Sites/MAMP/backdrop2/www
luke@lukes-MacBook-Pro$ drush cron
Drush command terminated abnormally due to an unrecoverable error.                                                                         [error]
Error: Class 'Drupal\Core\Logger\RfcLogLevel' not found in phar:///Users/luke/bin/drush/commands/core/drupal/environment.inc, line 334

[Sun Feb 12 11:47 PM] ~/Sites/MAMP/backdrop2/www
luke@lukes-MacBook-Pro$ drush pm-update
The external command could not be executed due to an application error.                                                                    [error]
pm-updatestatus failed.                                                                                                                    [error]

[Sun Feb 12 11:47 PM] ~/Sites/MAMP/backdrop2/www
luke@lukes-MacBook-Pro$ drush uli
Unable to load class Drush\User\User                                                                                                       [error]
Unable to load class Drush\User\User                                                                                                       [error]
Unable to load class Drush\User\User                                                                                                       [error]
Unable to load class Drush\User\User                                                                                                       [error]
exception 'Drush\User\UserListException' with message 'Unable to find a matching user.' in                                                 [error]
phar:///Users/luke/bin/drush/lib/Drush/User/UserList.php:19
Stack trace:
#0 phar:///Users/luke/bin/drush/commands/user/user.drush.inc(409): Drush\User\UserList->__construct(1)
#1 [internal function]: drush_user_login()
#2 phar:///Users/luke/bin/drush/includes/command.inc(422): call_user_func_array('drush_user_logi...', Array)
#3 phar:///Users/luke/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#4 [internal function]: drush_command()
#5 phar:///Users/luke/bin/drush/includes/command.inc(199): call_user_func_array('drush_command', Array)
#6 phar:///Users/luke/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#7 phar:///Users/luke/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#8 phar:///Users/luke/bin/drush/includes/startup.inc(458): drush_main()
#9 phar:///Users/luke/bin/drush/includes/startup.inc(365): drush_run_main(false, '/', 'Phar detected. ...')
#10 phar:///Users/luke/bin/drush/drush(114): drush_startup(Array)
#11 /Users/luke/bin/drush(10): require('phar:///Users/l...')
#12 {main}

One thing I noticed is there are two backdrop_core.drush.inc files in this output one in DRUSH/commands/ and one in DRUSH/commands/backdrop/drush-1.x-0.x ... that is probably not helping things.

cellear commented 7 years ago

Well, I got rid of the DRUSH/commands/backdrop_core.drush.inc -- it didn't seem to make any difference. I'm happy to test anything or run any commands, if you think that would help shed light.

jenlampton commented 7 years ago

I'm using drush with MAMP and i'm having some success. What is it that needs to be tested?

jenlampton commented 6 years ago

@cellear I've got MAMP running all my backdrop sites, and I have a drush PHP version specified in my .bash_profile as follows:

export DRUSH_PHP=/Applications/MAMP/bin/php/php5.6.30/bin/php

I have drush installed at cd ~/drush (it's a clone of the drush-ops/drush github project, checked out to the 8.x branch) and I have backdrop's drush project cloned into ~/drush/commands/backdrop (this a clone of the backdrop-contrib/drush github project).

One thing I did not see in your terminal output above was the command drush cc drush which is what you should do if drush is changed. Perhaps try that and see if things start working? Removing the help wanted tag until someone can explain what help is wanted :)

serundeputy commented 5 years ago

@cellear @jenlampton Jen tested this pretty thoroughly in testing #7 ... closing this.