https://github.com/webdevcave/directory-crawler-php
Directory Crawler PHP is a simple PHP library for recursively crawling through directories and listing files and directories.
https://github.com/webdevcave/directory-crawler-php
crawler crawling directory path php php-library
Last synced: 4 months ago
JSON representation
Directory Crawler PHP is a simple PHP library for recursively crawling through directories and listing files and directories.
- Host: GitHub
- URL: https://github.com/webdevcave/directory-crawler-php
- Owner: WebdevCave
- License: mit
- Created: 2024-06-18T23:28:08.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-14T18:34:12.000Z (over 1 year ago)
- Last Synced: 2025-09-27T16:58:16.451Z (9 months ago)
- Topics: crawler, crawling, directory, path, php, php-library
- Language: PHP
- Homepage:
- Size: 40 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Directory Crawler

[](https://packagist.org/packages/webdevcave/directory-crawler)
[](https://packagist.org/packages/webdevcave/directory-crawler)
[](https://packagist.org/packages/webdevcave/directory-crawler)
[](https://packagist.org/packages/webdevcave/directory-crawler)
Directory Crawler PHP is a simple PHP library for recursively crawling through directories and listing files and
directories.
## Features
- Recursively crawls through a specified directory.
- Retrieves a list of files and directories within the specified directory.
- Retrieves a list of classes inside the repository (PSR4 structured repositories).
## Installation
You can install the package via Composer:
```bash
composer require webdevcave/directory-crawler-php
```
## Usage
```php
contents();
// Get all files
$files = $crawler->files();
// Get all directories
$directories = $crawler->directories();
// List classes inside the directories
$namespace = 'My\\Project\\';
$enforce = false; //Faster
//$enforce = true; //Reliable but slower. May cause performance issues, depending on the number of occurrences.
$classes = $crawler->classes($namespace, $enforce);
print_r(compact('path', 'contents', 'files', 'directories', 'classes')); //Show results
```
## Contributing
Contributions are welcome! Fork the repository, make your changes, and submit a pull request. Please ensure to write
tests for any new functionality or bug fixes.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.