Files
wp-agentic-writer/vendor/phpdocumentor/flyfinder/examples/01-find-hidden-files.php
Dwindi Ramadhana 690991c526 refactor: Cleanup git state - commit all staged changes
Major refactoring cleanup:
- Add new controller architecture (class-controller-*.php)
- Add new settings-v2 UI (views/settings-v2/)
- Add new CSS architecture (agentic-sidebar.css, tokens)
- Add esbuild build pipeline (scripts/build.js, package.json)
- Add composer dependencies (vendor/)
- Add frontend src directory (assets/js/src/index.jsx)
- Add documentation files
- Remove old/obsolete files (class-settings.php, old CSS)

This commits all pending changes from previous refactoring efforts.
2026-06-17 05:27:58 +07:00

32 lines
950 B
PHP

<?php
require_once(__DIR__ . '/../vendor/autoload.php');
use League\Flysystem\Filesystem;
use League\Flysystem\Memory\MemoryAdapter as Adapter;
use Flyfinder\Finder;
use Flyfinder\Specification\IsHidden;
/*
* First create a new Filesystem and add the FlySystem plugin
* In this example we are using a filesystem with the memory adapter
*/
$filesystem = new Filesystem(new Adapter());
$filesystem->addPlugin(new Finder());
// Create some demo files
$filesystem->write('test.txt', 'test');
$filesystem->write('.hiddendir/.test.txt', 'test');
//In order to tell FlyFinder what to find, you need to give it a specification
//In this example the specification will be satisfied by files and directories that are hidden
$specification = new IsHidden();
//FlyFinder will yield a generator object with the files that are found
$generator = $filesystem->find($specification);
$result = [];
foreach ($generator as $value) {
$result[] = $value;
}