phuxtil/find
Composer 安装命令:
composer require phuxtil/find
包简介
Easy interface for output of 'find' unix command
README 文档
README
Easy interface for output of find unix command
In Unix-like and some other operating systems, find is a command-line utility that searches one or more directory trees of a file system, locates files based on some user-specified criteria and applies a user-specified action on each matched file.
Installation
composer require phuxtil/find
Note: Use v1.x for compatibility with PHP v7.0.x Note: Use v2.x for compatibility with PHP v7.2+
Usage
find sample output
1560682188|1560682181|1560682181|0755|root|root|0|0|d|10245134|0|160|5|remote_fs/|/tmp/remote_fs/
1560682162|1560682181|1560682181|0644|root|root|0|0|f|10269956|8|1210|1|test.txt|/tmp/remote_fs/test.txt
1560682162|1560682181|1560682181|0644|root|root|0|0|f|10269956|8|1210|1|test_link.txt|/tmp/remote_fs/test_link.txt
Configuration
Use Phuxtil\Find\FindConfigurator for configuration options.
$configurator = (new FindConfigurator()) ->setFormat('%As|%Cs|%Ts|%#m|%u|%g|%U|%G|%y|%i|%b|%s|%n|%f|%p') ->setFormatDelimiter('|') ->setLineDelimiter("\n") ->setFindOutput(...);
Facade
$results = (new FindFacade())->process($configurator);
[
0 => Phuxtil\SplFileInfo\VirtualSplFileInfo {
path: "/tmp"
filename: "remote_fs"
basename: "remote_fs"
pathname: "/tmp/remote_fs"
extension: ""
realPath: "/tmp/remote_fs"
aTime: 2019-06-16 12:49:48
mTime: 2019-06-16 12:49:41
cTime: 2019-06-16 12:49:41
inode: "10245134"
size: "160"
perms: 0755
owner: "0"
group: "0"
type: "dir"
writable: true
readable: true
executable: true
file: false
dir: true
link: false
linkTarget: -1
}
1 => Phuxtil\SplFileInfo\VirtualSplFileInfo {
path: "/tmp/remote_fs"
filename: "test.txt"
basename: "test.txt"
pathname: "/tmp/remote_fs/test.txt"
extension: "txt"
realPath: "/tmp/remote_fs/test.txt"
aTime: 2019-06-16 12:49:22
mTime: 2019-06-16 12:49:41
cTime: 2019-06-16 12:49:41
inode: "10269956"
size: "1210"
perms: 0644
owner: "0"
group: "0"
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: -1
}
2 => Phuxtil\SplFileInfo\VirtualSplFileInfo {
path: "/tmp/remote_fs"
filename: "test_link.txt"
basename: "test_link.txt"
pathname: "/tmp/remote_fs/test_link.txt"
extension: "txt"
realPath: "/tmp/remote_fs/test_link.txt"
aTime: 2019-06-16 12:49:22
mTime: 2019-06-16 12:49:41
cTime: 2019-06-16 12:49:41
inode: "10269956"
size: "1210"
perms: 0644
owner: "0"
group: "0"
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
linkTarget: -1
}
]
The result is an array containing VirtualSplFileInfo objects which are compatible with \SplFileInfo.
echo $results[0]->getPathname(); # /tmp/remote_fs echo $results[1]->isReadable(); # true echo $results[2]->getSize(); # 1210
TDD
See tests for details.
phuxtil/find 适用场景与选型建议
phuxtil/find 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.95k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 06 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 phuxtil/find 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phuxtil/find 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 23
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-06-12