cline/globby
最新稳定版本:1.0.2
Composer 安装命令:
composer require cline/globby
包简介
User-friendly glob matching for PHP with negation patterns, directory expansion, and gitignore support
README 文档
README
Globby
A user-friendly glob matching library for PHP, inspired by sindresorhus/globby. Features multiple pattern support, negation patterns, gitignore integration, and a fluent configuration API.
Requirements
Requires PHP 8.4+
Installation
composer require cline/globby
Documentation
- Basic Usage - Pattern matching fundamentals, multiple patterns, negation, and streaming
- Filtering Options - Files vs directories, dotfiles, depth limiting, and path formatting
- Gitignore Integration - Respecting .gitignore rules and custom ignore files
- Advanced Patterns - Brace expansion, character classes, globstar, and escaping
Supported Options
| Option | Type | Default | Description |
|---|---|---|---|
cwd |
string |
getcwd() |
Current working directory |
expandDirectories |
bool|array |
true |
Auto-expand directories to glob contents |
gitignore |
bool |
false |
Respect .gitignore rules |
ignoreFiles |
string|array |
null |
Custom ignore file patterns |
ignore |
array |
[] |
Additional patterns to ignore |
onlyFiles |
bool |
true |
Match only files |
onlyDirectories |
bool |
false |
Match only directories |
dot |
bool |
false |
Include dotfiles |
deep |
int |
null |
Maximum traversal depth |
followSymbolicLinks |
bool |
true |
Follow symbolic links |
suppressErrors |
bool |
false |
Suppress file system errors |
absolute |
bool |
false |
Return absolute paths |
unique |
bool |
true |
Deduplicate results |
markDirectories |
bool |
false |
Add trailing slash to directories |
caseSensitiveMatch |
bool |
true |
Case-sensitive pattern matching |
baseNameMatch |
bool |
false |
Match patterns against basename only |
throwErrorOnBrokenSymbolicLink |
bool |
false |
Throw error on broken symlinks |
objectMode |
bool |
false |
Return GlobEntry objects instead of strings |
stats |
bool |
false |
Include file statistics (implies objectMode) |
fs |
FileSystemAdapter |
null |
Custom file system adapter |
Change log
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.
Credits
License
The MIT License. Please see License File for more information.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-02