slowprog/composer-copy-file
Composer 安装命令:
composer require slowprog/composer-copy-file
包简介
Composer script copying your files after install
关键字:
README 文档
README
Composer copy file
Composer script copying your files after install. Supports copying of entire directories, individual files and complex nested directories.
For example copy fonts:
{
"require":{
"twbs/bootstrap": "~3.3",
"slowprog/composer-copy-file": "~0.3"
},
"scripts": {
"post-install-cmd": [
"SlowProg\\CopyFile\\ScriptHandler::copy"
],
"post-update-cmd": [
"SlowProg\\CopyFile\\ScriptHandler::copy"
]
},
"extra": {
"copy-file": {
"vendor/twbs/bootstrap/fonts/": "web/fonts/"
}
}
}
In a development you may use -dev suffix. For example copy non-minified in development and minified in production:
{
"require":{
"twbs/bootstrap": "~3.3",
"slowprog/composer-copy-file": "~0.3"
},
"scripts": {
"post-install-cmd": [
"SlowProg\\CopyFile\\ScriptHandler::copy"
],
"post-update-cmd": [
"SlowProg\\CopyFile\\ScriptHandler::copy"
]
},
"extra": {
"copy-file": {
"vendor/twbs/bootstrap/dist/js/bootstrap.min.js": "web/js/bootstrap.js"
},
"copy-file-dev": {
"vendor/twbs/bootstrap/dist/js/bootstrap.js": "web/js/bootstrap.js"
}
}
}
Use cases
You need to be careful when using a last slash. The file-destination is different from the directory-destination with the slash.
If in destination directory already exists copy of file, then it will be override. To overwrite only older files append ? in end of destination path.
Source directory hierarchy:
dir/
subdir/
file1.txt
file2.txt
-
Dir-to-dir:
{ "extra": { "copy-file": { "dir/subdir/": "web/other/" } } }Result:
web/ other/ file1.txt file2.txt -
File-to-dir:
{ "extra": { "copy-file": { "dir/subdir/file1.txt": "web/other/", "dir/subdir/file2.txt": "web/other/file2.txt/" } } }Result:
web/ other/ file1.txt file2.txt/ file2.txt -
File-to-file:
{ "extra": { "copy-file": { "dir/subdir/file1.txt": "web/other/file1.txt", "dir/subdir/file2.txt": "web/other/file_rename.txt" } } }Result:
web/ other/ file1.txt file_rename.txt -
Override only older files:
{ "extra": { "copy-file": { "dir/subdir/": "web/other/?" } } }Preset:
web/ other/ file1.txt - Recently modified file2.txt - Old rotten fileResult:
web/ other/ file1.txt - Not changed file2.txt - Replaced -
Filter source files by regexp pattern
{ "extra": { "copy-file": { "dir/subdir#1\.\w{3}$": "web/other/" } } }Result:
web/ other/ file1.txt
slowprog/composer-copy-file 适用场景与选型建议
slowprog/composer-copy-file 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.08M 次下载、GitHub Stars 达 48, 最近一次更新时间为 2015 年 08 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「copy file」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 slowprog/composer-copy-file 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 slowprog/composer-copy-file 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 slowprog/composer-copy-file 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Copy files with better control over copying than the default Phing CopyTask
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
Synchronise two directories.
The InstantConfigurationCopy module provides easy way to copy configuration field information for admin in back office Magento 2.
Laravel Media Popup to upload/view the files
PMVC Plugin for File information
统计信息
- 总下载量: 1.08M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 49
- 点击次数: 20
- 依赖项目数: 37
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-02