PHP code example of 7csn / utils-finder
1. Go to this page and download the library: Download 7csn/utils-finder library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
7csn / utils-finder example snippets
use chaser\utils\Finder;
# 获取文件或文件夹详情,非文件或文件夹返回 null
Finder::list(string $path): ?array;
# (递归)检索文件夹内指定后缀文件,非文件夹返回 null
Finder::scan(string $dir, string $ext = '.php', bool $deep = true): ?array;
# 检索文件夹内类库,非文件夹返回 null
# $namespace 为命名空间前缀
Finder::class(string $dir, string $namespace = null, bool $deep = true): ?array;