projek-xyz/slim-flysystem
Composer 安装命令:
composer require projek-xyz/slim-flysystem
包简介
Access your Slim 3 application file system using FlySystem.
README 文档
README
FlySystem Integration for Slim micro framework 3
Access your Slim 3 application file system using FlySystem.
Install
Via Composer
$ composer require projek-xyz/slim-flysystem --prefer-dist
Requires Slim micro framework 3 and PHP 5.5.0 or newer.
Usage
// 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.
// ...
Contributing
Please see CONTRIBUTING and CONDUCT for details.
License
This library is open-sourced software licensed under MIT license.
统计信息
- 总下载量: 144
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-16