PHP code example of neutron / silex-filesystem-provider

1. Go to this page and download the library: Download neutron/silex-filesystem-provider 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/ */

    

neutron / silex-filesystem-provider example snippets


use Silex\Application;
use Neutron\Silex\Provider\FilesystemServiceProvider;

$app = new Application();
// Register the filesystem
$app->register(new FilesystemServiceProvider());

// Just use it as any Silex service
if (!$app['filesystem']->exists('any-absolute-or-relative-path...')) {
	throw new \Namespace\PathNotFoundCustomException();
}