Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1-rc"
- "8.1"
operating-system:
- "ubuntu-latest"
- "windows-latest"
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,13 @@ $iterator = new GlobFilterIterator(

Relative globs such as `*.css` are not supported. Usually, such globs refer to
paths relative to the current working directory. This utility, however, does not
want to make such assumptions. Hence you should always pass absolute globs.

If you want to allow users to pass relative globs, I recommend to turn the globs
into absolute globs using the [Webmozart Path Utility]:
want to make such assumptions. Hence you should always pass absolute globs, so
usage of `__DIR__` is encouraged:

```php
use Webmozart\Glob\Glob;
use Webmozart\PathUtil\Path;

// If $glob is absolute, that glob is used without modification.
// If $glob is relative, it is turned into an absolute path based on the current
// working directory.
$paths = Glob::glob(Path::makeAbsolute($glob, getcwd());
$paths = Glob::glob(__DIR__ . '/*');
```

### Windows Compatibility
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
}
],
"require": {
"php": "^7.3 || ^8.0.0",
"webmozart/path-util": "^2.2"
"php": "^7.3 || ^8.0.0"
},
"require-dev": {
"symfony/filesystem": "^5.3",
Expand Down
Loading