Permalink
Browse files

tweaked the README files

  • Loading branch information...
1 parent fe6e93d commit bc74d692248d877684a916ecc9ceb5cf53cac7fa @fabpot fabpot committed Dec 18, 2011
Showing with 19 additions and 24 deletions.
  1. +19 −24 README.md
View
@@ -1,39 +1,34 @@
Finder Component
================
-The Finder provides a very convenient and nice fluent interface to find files
-and directories on the filesystem:
+Finder finds files and directories via an intuitive fluent interface.
-```
-use Symfony\Component\Finder\Finder;
+ use Symfony\Component\Finder\Finder;
-$finder = new Finder();
+ $finder = new Finder();
-$iterator = $finder
- ->files()
- ->name('*.php')
- ->depth(0)
- ->size('>= 1K')
- ->in(__DIR__);
+ $iterator = $finder
+ ->files()
+ ->name('*.php')
+ ->depth(0)
+ ->size('>= 1K')
+ ->in(__DIR__);
-foreach ($iterator as $file) {
- print $file->getRealpath()."\n";
-}
-```
+ foreach ($iterator as $file) {
+ print $file->getRealpath()."\n";
+ }
But you can also use it to find files stored remotely like in this example where
we are looking for files on Amazon S3:
-```
-$s3 = new \Zend_Service_Amazon_S3($key, $secret);
-$s3->registerStreamWrapper("s3");
+ $s3 = new \Zend_Service_Amazon_S3($key, $secret);
+ $s3->registerStreamWrapper("s3");
-$finder = new Finder();
-$finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
-foreach ($finder->in('s3://bucket-name') as $file) {
- print $file->getFilename()."\n";
-}
-```
+ $finder = new Finder();
+ $finder->name('photos*')->size('< 100K')->date('since 1 hour ago');
+ foreach ($finder->in('s3://bucket-name') as $file) {
+ print $file->getFilename()."\n";
+ }
Resources
---------

0 comments on commit bc74d69

Please sign in to comment.