• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

Adapter/H03-May-2022-1,018534

Comparator/H03-May-2022-237110

Exception/H03-May-2022-15749

Expression/H03-May-2022-688326

Iterator/H03-May-2022-1,026455

Shell/H03-May-2022-391162

Tests/H03-May-2022-2,9521,900

CHANGELOG.mdH A D27-Apr-20141,014 3124

Finder.phpH A D27-Apr-201421.7 KiB830318

Glob.phpH A D27-Apr-20143.1 KiB10456

LICENSEH A D27-Apr-20141 KiB2016

README.mdH A D27-Apr-2014965 4229

SplFileInfo.phpH A D27-Apr-20141.8 KiB7832

autoloader.phpH A D27-Apr-2014336 1613

composer.jsonH A D27-Apr-2014731 3231

phpunit.xml.distH A D27-Apr-2014821 3027

README.md

1Finder Component
2================
3
4Finder finds files and directories via an intuitive fluent interface.
5
6    use Symfony\Component\Finder\Finder;
7
8    $finder = new Finder();
9
10    $iterator = $finder
11      ->files()
12      ->name('*.php')
13      ->depth(0)
14      ->size('>= 1K')
15      ->in(__DIR__);
16
17    foreach ($iterator as $file) {
18        print $file->getRealpath()."\n";
19    }
20
21But you can also use it to find files stored remotely like in this example where
22we are looking for files on Amazon S3:
23
24    $s3 = new \Zend_Service_Amazon_S3($key, $secret);
25    $s3->registerStreamWrapper("s3");
26
27    $finder = new Finder();
28    $finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
29    foreach ($finder->in('s3://bucket-name') as $file) {
30        print $file->getFilename()."\n";
31    }
32
33Resources
34---------
35
36You can run the unit tests with the following command:
37
38    $ cd path/to/Symfony/Component/Finder/
39    $ composer.phar install
40    $ phpunit
41
42