cline / globby
User-friendly glob matching for PHP with negation patterns, directory expansion, and gitignore support
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/cline/globby
Requires
- php: ^8.5.0
- illuminate/contracts: ^11.0 || ^12.0
- illuminate/filesystem: ^11.0 || ^12.0
- illuminate/support: ^11.0 || ^12.0
- spatie/laravel-package-tools: ^1.92.7
Requires (Dev)
- cline/php-cs-fixer: ^1.0.4
- driftingly/rector-laravel: ^2.0.7
- ergebnis/composer-normalize: ^2.49@dev
- laravel/pint: ^1.25.1
- orchestra/testbench: ^10.6
- pestphp/pest: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-type-coverage: ^4.0
- phpstan/phpstan: ^2.1.30
- rector/rector: ^2.2.1
- symfony/var-dumper: ^7.3.4
- symplify/easy-coding-standard: ^13.0
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.