Skip to content

[Component][Finder] Documented wildcard (glob pattern) support #2089

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 27, 2013
Merged

[Component][Finder] Documented wildcard (glob pattern) support #2089

merged 1 commit into from
Jan 27, 2013

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Jan 2, 2013

No description provided.

fabpot added a commit to symfony/symfony that referenced this pull request Jan 3, 2013
This PR was merged into the master branch.

Commits
-------

29b9611 [Finder] Added support for GLOB patterns in the directories passed to the in() method.

Discussion
----------

[Finder] Added support for wildcard characters (GLOB patterns)

Added support for wildcard characters in the paths passed to the *in()* method. Each pattern has to resolve to at least one directory, otherwise exception is thrown (just like when path to an invalid directory is passed).

Example usage:

```php
$finder = new \Symfony\Component\Finder\Finder();
$files = $finder->files()
    ->name('validators.en.*')
    ->in(array(
        'src/Symfony/*/*/Resources/translations',
    ));

foreach ($files as $file) {
    var_dump($file->getRealPath());
}
```

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #5450
Todo: -
License of the code: MIT
Documentation PR: symfony/symfony-docs#2089
weaverryan added a commit that referenced this pull request Jan 27, 2013
[Component][Finder] Documented wildcard (glob pattern) support
@weaverryan weaverryan merged commit fb97719 into symfony:master Jan 27, 2013
@weaverryan
Copy link
Member

Brilliand @jakub! Thanks so much for this nice feature + the docs :).

@jakzal jakzal deleted the finder-glob-support branch January 27, 2013 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants