https://github.com/projek-xyz/slim-flysystem
Access your Slim 3 application file system using FlySystem.
https://github.com/projek-xyz/slim-flysystem
flysystem slim-3 slimphp
Last synced: about 1 year ago
JSON representation
Access your Slim 3 application file system using FlySystem.
- Host: GitHub
- URL: https://github.com/projek-xyz/slim-flysystem
- Owner: projek-xyz
- License: mit
- Created: 2015-12-16T22:57:27.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-04-16T03:41:34.000Z (about 1 year ago)
- Last Synced: 2025-04-16T04:46:23.326Z (about 1 year ago)
- Topics: flysystem, slim-3, slimphp
- Language: PHP
- Homepage:
- Size: 96.7 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://packagist.org/packages/projek-xyz/slim-flysystem)
[](https://github.com/projek-xyz/slim-flysystem/blob/main/LICENSE)
[](https://github.com/projek-xyz/slim-flysystem/actions)
[](https://coveralls.io/github/projek-xyz/slim-flysystem)
[](https://codeclimate.com/github/projek-xyz/slim-flysystem/coverage)
[](https://codeclimate.com/github/projek-xyz/slim-flysystem/maintainability)
[](https://insight.symfony.com/projects/847662a6-71b8-4e7b-ae16-d7f98b7eae80)
# FlySystem Integration for Slim micro framework 3
Access your Slim 3 application file system using FlySystem.
## Install
Via [Composer](https://getcomposer.org/)
```bash
$ composer require projek-xyz/slim-flysystem --prefer-dist
```
Requires Slim micro framework 3 and PHP 5.5.0 or newer.
## Usage
```php
// Create Slim app
$app = new \Slim\App();
// Fetch DI Container
$container = $app->getContainer();
// Register FlySystem helper:
// Option 1, using FlysystemProvider
$container->register(new \Projek\Slim\FlysystemProvider);
// Option 2, using Closure
$container['fs'] = function ($c) {
$fs = new \Projek\Slim\Flysystem([
'local' => [
'path' => 'path/to/your/resources',
]
]);
return $fs;
};
// Define named route
$app->get('/hello/{name}', function ($request, $response, $args) {
// Read a file.
$this->fs->read('path/to/file');
return $response;
});
// Run app
$app->run();
```
**NOTE**: if you are using _option 1_ please make sure you already have `$container['settings']['filesystem']` in your configuration file.
## Custom functions
Description soon.
### `aFunction()`
Description soon.
```php
// ...
```
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CONDUCT.md) for details.
## License
This library is open-sourced software licensed under [MIT license](LICENSE.md).