laasti / flysystem-provider
Flysystem 的联盟/容器 v2 服务提供商。
v2.0.1
2016-04-21 12:16 UTC
Requires
- league/container: ^2.0.3
- league/flysystem: ~1.0
This package is auto-updated.
Last update: 2024-09-20 23:39:21 UTC
README
安装
composer require laasti/flysystem-provider
用法
$container = new League\Container\Container; $container->addServiceProvider('Laasti\FlysystemProvider\FlysystemProvider'); //The first defined adapter is used as the default for League\Flysystem\FilesystemInterface $container->add('config.flysystem', [ //the first item in array is the adapter class, the second is the adapter's constructor parameters 'upload' => ['League\Flysystem\Adapter\Local', ['your-uploads-directory']], 'temp' => ['League\Flysystem\Adapter\Local', ['your-temp-directory']], //see League/Flysystem's documentation for more adapters ]); $manager = $container->get('League\Flysystem\MountManager'); $manager->read('upload://path-to-file.txt); //or get the default filesystem $filesystem = $container->get('League\Flysystem\FilesystemInterface'); //or get a filesystem by its name from the container $tempFiles = $container->get('flysystem.filesystem.temp'); //or an adapter $tempAdapter = $container->get('flysystem.adapter.temp');
贡献
- 分支它!
- 创建您的功能分支:
git checkout -b my-new-feature
- 提交您的更改:
git commit -am '添加一些功能'
- 推送到分支:
git push origin my-new-feature
- 提交拉取请求 :D
历史
查看Github的发布或标签
鸣谢
作者:Sonia Marquette (@nebulousGirl)
许可
在MIT许可证下发布。请参阅LICENSE.txt文件。