1. Go to this page and download the library: Download metra/cascading-filesystem 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/ */
metra / cascading-filesystem example snippets
// Enable composer autoloading
use Kohana\CascadingFilesystem\Filesystem\CascadingFilesystem;
use Doctrine\Common\Cache\ArrayCache;
// Instantiate cache
$cache = new ArrayCache();
// Instantiate CFS
$cfs = new CascadingFilesystem($cache, [
'directory/path/one',
'directory/path/two',
'directory/path/three',
]);
// Get absolute path
$path = $cfs->getPath('code/foo.php');
// Get all absolute paths
$paths = $cfs->getAllPaths('code/foo.php');
// List directory contents
$files = $cfs->listFiles('code');
use Kohana\CascadingFilesystem\Initializer\ModulesInitializer;
// Initialize all modules
(new ModulesInitializer($cfs))->initialize();
use Kohana\CascadingFilesystem\Autoloader\ModulesAutoloader;
// Register Kohana module autoloader
(new ModulesAutoloader($cfs))->register();
use Kohana\CascadingFilesystem\Autoloader\LegacyModulesAutoloader;
// Register legacy Kohana module autoloader
(new LegacyModulesAutoloader($cfs))->register();