定制 drush/drush-launcher 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drush/drush-launcher

最新稳定版本:0.10.2

Composer 安装命令:

composer require drush/drush-launcher

包简介

Provides a drush executable for your global PATH

README 文档

README

Add ./vendor/bin to the front of your $PATH. This relative path works for any Drupal codebase on your system if you run commands from the project root. And it is harmless otherwise. Other options include direnv, fd, or the scripts in this issue.

Description

In order to avoid dependency issues, it is best to require Drush on a per-project basis via Composer (composer require drush/drush). This makes Drush available to your project by placing it at vendor/bin/drush.

However, it is inconvenient to type vendor/bin/drush in order to execute Drush commands. By installing the drush launcher globally on your local machine, you can simply type drush on the command line, and the launcher will find and execute the project specific version of drush located in your project's vendor directory.

Installation - Phar

  1. Download latest stable release via CLI (code below) or browse to https://github.com/drush-ops/drush-launcher/releases/latest.

    OSX:

    curl -OL https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar

    Linux:

    wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/latest/download/drush.phar
  2. Make downloaded file executable: chmod +x drush.phar

  3. Move drush.phar to a location listed in your $PATH, rename to drush:

    sudo mv drush.phar /usr/local/bin/drush
  4. Windows users: create a drush.bat file in the same folder as drush.phar with the following lines. This gets around the problem where Windows does not know that the drush file is associated with php:

    @echo off
    php "%~dp0\drush" %*

Update

The Drush Launcher Phar is able to self update to the latest release.

    drush self-update

Fallback

When a site-local Drush is not found, this launcher usually throws a helpful error. You may avoid the error and instead hand off execution to a global Drush (any version) by exporting an environment variable.

export DRUSH_LAUNCHER_FALLBACK=/path/to/drush

Xdebug compatibility

Drush Launcher, like Composer automatically disables Xdebug by default. This improves performance substantially. You may override this feature by setting an environment variable. DRUSH_ALLOW_XDEBUG=1 drush [command]

License

GPL-2.0+

统计信息

  • 总下载量: 22.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 240
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 240
  • Watchers: 13
  • Forks: 46
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2017-08-04