Drupal弃草了吗?


8

我离开Drupal已有2-3年了。我只是回来了,并通过composer安装了drush(如drush网站所推荐),现在每次尝试使用drush时,都会收到一条消息,告诉我应该使用composer:

~/sites/d7 $ drush version
 Drush version : 9.0-dev-gd4a3872
~/sites/d7 $ drush dl drupal-7.x
 [notice] dl has been deprecated. Please build your site using Composer. Add new projects with composer require drupal/[project-name]. Use https://www.drupal.org/project/composer_generate to build a composer.json which represents the the enabled modules on your site.

我按照这些说明通过composer安装drupal的说明下载了drupal 8 ,但是当我尝试在该项目中使用drush时,我收到此消息:

~/sites/cfbtv/web $ drush dl devel
This codebase is assembled with Composer instead of Drush. Use `composer update` and `composer require` instead of `drush pm-updatecode` and `drush pm-download`. You may override this error by [error]
using the --pm-force option.

我的本地环境有问题吗,或者现在匆忙已成为过去?

Answers:


22

您已经安装了masterDrush 的开发分支。要继续使用,如命令drush dldrush pm-update等等,你应该安装Drush的8.x的分支

但是,您的基本假设是正确的。Drupal社区正朝Composer转移,远离drush make了drush pm-*命令。这样做的原因是,越来越多的Drupal模块依赖于通过Composer库分发的代码。当使用具有Composer依赖性的模块时,最便捷的方式来管理Drupal站点是通过Composer。有关此示例,请参见drupal-composer / drupal-project

所有其他Drush命令仍然相关并且仍然有用。


嗯谢谢 使用drush来管理D8的人仍然有足够的文档,很难确定作曲家是要替换drush还是只是用来安装/管理drush。无论如何,这很快使我回到了我熟悉的高峰:$ composer require drush/drush:8.x
doub1ejack
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.