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
-
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
-
Make downloaded file executable:
chmod +x drush.phar -
Move drush.phar to a location listed in your
$PATH, rename todrush:sudo mv drush.phar /usr/local/bin/drush
-
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
drushfile is associated withphp:@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+
drush/drush-launcher 适用场景与选型建议
drush/drush-launcher 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 22.89k 次下载、GitHub Stars 达 240, 最近一次更新时间为 2017 年 08 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 drush/drush-launcher 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 drush/drush-launcher 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 22.89k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 240
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2017-08-04