yiisoft/files

Check a file-finder use-case

samdark opened this issue · 1 comments

Use-case from @roxblnfk.

File-finder input (aliases do not matter):

@app/database/schema.php
@app/modules/*/database/schema.php
vendor/yii-megasoft/admin/database/schema/**.php

Expected output:

src/database/schema.php
src/modules/user/database/schema.php
src/modules/blog/database/schema.php
vendor/yii-megasoft/admin/database/schema/rbac/roles.php
vendor/yii-megasoft/admin/database/schema/rbac/assignes.php
vendor/yii-megasoft/admin/database/schema/menu.php

In case src/database/schema.php does not exist, either myself (by having a list of output files), or finder should throw and exception. The rest of the files matching are result of scanning of file system. If there are no such files, it doesn't matter. i.e. strict match in case the pattern isn't used, optional match if pattern is used.