daanbiesterbos / command-extra-bundle
这是一个最小的symfony扩展包,用于向symfony命令添加功能。
v1.0.1
2021-04-16 18:04 UTC
Requires
- php: ^7.3
- symfony/config: ^4.4|^5
- symfony/console: ^4.4|^5
- symfony/dependency-injection: ^4.4|^5
Requires (Dev)
- phpunit/phpunit: ^9
- roave/security-advisories: dev-master
README
安装
该扩展包可在Packagist上找到。您可以使用Composer进行安装。
composer require daanbiesterbos/command-extra-bundle
步骤2:启用扩展包
将扩展包添加到config/bundles.php
return [ DaanBiesterbos\CommandExtraBundle\CommandExtraBundle::class => ['all' => true], ];
步骤3:配置扩展包
最后,配置扩展包
# config/packages/command_extra.yaml command_extra: aliases: # Example 1: # Register alias to run a non symfony command. ps: name: 'ps' description: 'Shorthand example of a non symfony command.' execute: 'ps -aux' # This shorthand is for non-symfony commands only. # Example 2 # Register alias that runs two symfony commands when invoked. cache_purge: name: 'cache:purge' description: 'Prune cache pools and application cache.' execute: # Run multiple commands cache_pool: command: 'cache:pool:prune' symfony: true app_cache: command: 'cache:clear' symfony: true