nette/finder
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
nette/utils | v4.0.4 | 61.98 kB | (BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only) | prod | 1 |
The Nette Finder is a powerful tool for swiftly finding files and directories through an intuitive API. Whether you're trying to navigate a complex directory structure or simply looking for a single file among the clutter, Nette Finder has been streamlined to make the process as straightforward as possible. You'll find that tasks you used to dread are now executed with ease.
To utilize Nette Finder, you need to have it installed via Composer(require nette/finder). Here is an example of how to use it:
use Nette\Utils\Finder;
// Find all jpg, png, and gif images in the current directory
$images = Finder::findFiles('*.jpg', '*.png', '*.gif')->from(__DIR__);
foreach ($images as $image) {
echo "Image Found: " .$image ."\n";
}
This simple script will look for all JPEG, PNG, and GIF files in the current directory and print out their relative paths.
You can also search for directories:
$dirs = Finder::findDirs('test-dir')->from('/path/to/search');
foreach ($dirs as $dir) {
echo "Directory Found: " .$dir."\n";
}
These are just the basics - Nette Finder houses a variety of powerful functionalities that cater to advanced needs.
For an exhaustive guide on how to leverage the Nette Finder to its full potential, you can reference the official documentation. Please note that the library has been moved to the nette/utils namespace, so make sure to update your project dependencies to avoid any interruptions.