11Nette Finder: Files Searching
22=============================
33
4- [ ![ Downloads this Month] ( https://img.shields.io/packagist/dm/nette/finder.svg )] ( https://packagist.org/packages/nette/finder )
5- [ ![ Tests] ( https://github.com/nette/finder/workflows/Tests/badge.svg?branch=master )] ( https://github.com/nette/finder/actions )
6- [ ![ Coverage Status] ( https://coveralls.io/repos/github/nette/finder/badge.svg?branch=master )] ( https://coveralls.io/github/nette/finder?branch=master )
7- [ ![ Latest Stable Version] ( https://poser.pugx.org/nette/finder/v/stable )] ( https://github.com/nette/finder/releases )
8- [ ![ License] ( https://img.shields.io/badge/license-New%20BSD-blue.svg )] ( https://github.com/nette/finder/blob/master/license.md )
9-
10-
11- Introduction
12- ------------
13-
144Nette Finder makes browsing the directory structure really easy.
155
166Documentation can be found on the [ website] ( https://doc.nette.org/finder ) .
177
8+ ** The library has been moved to the [ nette/utils] ( https://github.com/nette/utils ) **
9+
1810
1911[ Support Me] ( https://github.com/sponsors/dg )
2012--------------------------------------------
@@ -30,7 +22,7 @@ Installation
3022------------
3123
3224``` shell
33- composer require nette/finder
25+ composer require nette/utils
3426```
3527
3628All examples assume the following class alias is defined:
@@ -48,11 +40,11 @@ How to find all `*.txt` files in `$dir` directory and all its subdirectories?
4840``` php
4941foreach (Finder::findFiles('*.txt')->from($dir) as $key => $file) {
5042 // $key is a string containing absolute filename with path
51- // $file is an instance of SplFileInfo
43+ // $file is an instance of Nette\Utils\FileInfo
5244}
5345```
5446
55- The files in the ` $file ` variable are instances of the ` SplFileInfo ` class.
47+ The files in the ` $file ` variable are instances of the ` Nette\Utils\FileInfo ` class.
5648
5749If the directory does not exist, an ` Nette\UnexpectedValueException ` is thrown.
5850
@@ -113,7 +105,7 @@ Finder::findFiles('*.txt')
113105 ->exclude('*X*')
114106```
115107
116- If ` exclude() ` is specified ** after ** ` from() ` , it applies to crawled subdirectories:
108+ And use ` exclude() ` to skip crawled subdirectories:
117109
118110``` php
119111Finder::findFiles('*.php')
@@ -148,7 +140,7 @@ Both functions understand the operators `>`, `>=`, `<`, `<=`, `=`, `!=`.
148140Here we traverse PHP files with number of lines greater than 1000. As a filter we use a custom callback:
149141
150142``` php
151- $hasMoreThan100Lines = function (SplFileInfo $file): bool {
143+ $hasMoreThan100Lines = function (FileInfo $file): bool {
152144 return count(file($file->getPathname())) > 1000;
153145};
154146
0 commit comments