Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Glob Laravel Package

webmozart/glob

Ant-like globbing for PHP with support for , ?, [], {}, and // to match directories. Glob filesystem paths (including stream wrappers), match globs against strings, and filter path arrays. Uses native glob() when possible; throws on invalid patterns.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: Excellent standalone utility for Laravel's filesystem operations. Complements Symfony components already in Laravel stack. Stream wrapper support aligns with Laravel's storage drivers (S3, FTP, etc.). No framework dependencies or service container requirements.
Integration feasibility: Extremely low friction. Simple Composer dependency. Can be used directly via Glob::glob() or injected. Works seamlessly with Laravel path helpers (base_path(), storage_path()).
Technical risk: Low. Mature package (last release 2024-03-07), handles edge cases (Windows, musl), and falls back to native glob() for performance. Primary risk is regex-based scanning for complex patterns in high-frequency paths.
Key questions: How does it handle symbolic links? Does it support depth-limited recursion beyond /**/? Are there performance implications for 100k+ file scans in production?

Integration Approach

Stack fit: Ideal for Laravel tasks requiring advanced glob patterns (e.g., view discovery, asset compilation, plugin scanning). Works with storage_path(), public_path(), and custom stream wrappers like s3://.
Migration path: Replace native glob() calls where advanced syntax is needed (e.g., {a,b}, /**/). Start with non-critical paths (e.g., config discovery), then scale to performance-sensitive areas. Use Glob::filter() for array-based path processing.
Compatibility: Requires PHP 7.3+ (Laravel 8+ compatible). Paths must be absolute (use Laravel helpers). Forward slashes enforced - no Windows path issues.
Sequencing: 1) Audit existing glob() usage for pattern limitations. 2) Replace with Glob::glob() for specific use cases needing {} or /**/. 3) Benchmark against native glob() for hot paths. 4) Use iterators for large directory scans.

Operational Impact

Maintenance: Minimal. Stable release history (1-2 releases/year), no breaking changes in recent versions. No Laravel-specific maintenance needed. Dependents count of 0 is misleading (used internally by many projects).
Support: GitHub issue-based support. Documentation is thorough. No dedicated Laravel support but simplicity reduces support overhead. Community activity is moderate (257 stars, 1 contributor in last release).
Scaling: Handles large directories via GlobIterator (streaming results). Recursive patterns (/**/) may slow for deep trees - avoid in high-throughput paths. Native glob() fallback ensures baseline performance for simple patterns.
Failure modes: Invalid syntax throws InvalidArgumentException (must be caught for user-facing ops). Unreadable directories may fail silently (depends on PHP's glob() behavior). Stream wrapper failures require specific error handling.
Ramp-up: Low. Developers familiar with glob syntax adapt quickly. Critical to document escaping rules (\\\\ for literal \) and Windows path normalization. Training should emphasize absolute paths and iterator usage for large datasets.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4