mbrowniebytes / yii2-clean-vendors
通过删除docs、tests、gits等,清理composer的vendor/目录
dev-master
2017-12-21 02:57 UTC
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-23 12:22:09 UTC
README
此扩展从composer的vendor/目录中删除docs、tests、gits等
它基于 barryvdh/composer-cleanup-plugin
规则格式和删除逻辑已被复制。
主要更改如下
- 作为Yii2命令调用
- 提供进度反馈
- 添加默认规则
安装
安装此扩展的首选方式是通过 composer。
运行以下命令:
php composer.phar require mbrowniebytes/yii2-clean-vendors:dev-master
或者
"mbrowniebytes/yii2-clean-vendors": "dev-master"
将其添加到composer.json的require部分。
使用方法
要使用此扩展,请将以下代码添加到您的应用程序配置文件(console.php)中
'controllerMap' => [ 'clean-vendors' => [ 'class' => 'mbrowniebytes\yii2cleanvendors\CleanVendorsController', ], ],
然后从命令行调用扩展
/path/yii> php yii clean-vendors
Checking vendor/ to remove docs, gits, tests, etc ..
Checking 56 vendor packages ..
Done. Scanned 25 vendor packages, cleaned 10 files/dirs
或将扩展添加到composer scripts部分以始终清理vendors
"scripts": {
"post-update-cmd": [
"php yii clean-vendors"
]
},
附加参数
-dry-run do not delete anything
-verbose echo rules being run, dir/file being deleted
-silent do not echo anything