skoziel / silex-filesystem
The Symfony Filesystem Service Provider for Silex 2.0
1.0.3
2017-12-25 09:56 UTC
Requires
- php: >=5.6
- symfony/filesystem: ~3.0
Requires (Dev)
- silex/silex: >=2.0
This package is auto-updated.
Last update: 2025-03-12 19:59:34 UTC
README
The Filesystem Service Provider for Silex 2.0 based on The Symfony 3.2 File System Component
Requirements
- silex/silex >=2.0
- PHP >= 5.6
Registering
$app->register(new SKoziel\Silex\Filesystem\FileSystemServiceProvider());
Trait
use SKoziel\Silex\Filesystem\FileSystemServiceProviderTrait; $app->mkdir('/tmp/photos', 0700);
Usage
The Filesystemm Service Provider provides the same functionality as The Filesystem Component. Example usage:
$app['filesystem']->mkdir('/tmp/photos', 0700); // this directory exists, return true $app['filesystem']->exists('/tmp/photos'); // works only if image-ICC has been modified after image.jpg $app['filesystem']->copy('image-ICC.jpg', 'image.jpg');