New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent loading of Drush9 commands in Drush 8.x #3456
Comments
Easiest thing to do is delete PolicyCommands.php as it is made for Drush9. I'll see what can be done about the error. |
This was probably introduced when drupal-composer/drupal-project#351 went in. |
@greg-1-anderson said he may look into preventing the loading of these commands in 8.x |
Drush 8.1.17 has some basic interoperability with Drush 9 command files, so the policy file from drupal-composer/drupal-project no longer crashes Drush 8. |
Is the following related? I can't use my global Drush 8.2.3 anymore inside a non-Composer D7 due to the following error. I think this happened after I cloned Drush master into the folder above the non-Composer D7 project. Renaming the $ drush8 -y sql-drop
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Class 'Drush\Commands\DrushCommands' not found in
/Users/leymannx/Sites/drush/src/Commands/pm/SecurityUpdateCommands.php,
line 15 |
Drush will look for preferences in a directory named 'drush' in the folder above the document root. Perhaps this code could detect and exclude directories that were entire Drush installs. You should try with 8.3.0 and see if that works better, too. |
After installing Drupal 8 including Drush 9.x with composer
composer create-project drupal-composer/drupal-project:8.x-dev foldername --stability dev --no-interaction
and downgrading to Drush 8.x
composer require drush/drush:8.x
I get the following error message when trying to run
drush
PHP Fatal error: Class 'Drush\Commands\DrushCommands' not found in /var/www/html/path-to-site/drush/Commands/PolicyCommands.php on line 11
Drush command terminated abnormally due to an unrecoverable error.
Error: Class 'Drush\Commands\DrushCommands' not found in /var/www/html/path-to-site/drush/Commands/PolicyCommands.php, line 11
After removing the folder 'drush' from the root directory, it works fine.
It seems as if when uninstalling Drush 9.x, Composer didn't properly remove it from the Composer project. Sorry, I'm not sure where to report this bug -- is it Composer's fault?
The text was updated successfully, but these errors were encountered: