Skip to content

Commit

Permalink
Replaced webmozart/path-util dependency with @internal `Path::isA…
Browse files Browse the repository at this point in the history
…bsolute()`

This imports sources from `webmozart/path-util`: since the license
and authors are the same, no further license additions are necessary.

Ref: https://github.com/webmozart/path-util/blob/6099b5238073f87f246863fd58c2e447acfc0d24/tests/PathTest.php
Ref: https://github.com/webmozart/path-util/blob/6099b5238073f87f246863fd58c2e447acfc0d24/src/Path.php

Fixes #59
Fixes #57
  • Loading branch information
Ocramius committed Apr 5, 2022
1 parent 539b5db commit c96747f
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 206 deletions.
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
331 changes: 140 additions & 191 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c96747f

Please sign in to comment.