dspacelabs / filesystem
dev-master / 0.1.x-dev
2016-01-17 01:13 UTC
Requires
- dspacelabs/cache: ^0.1@dev
- psr/log: ^1.0
Requires (Dev)
- aws/aws-sdk-php: ^3.4
- mockery/mockery: ~1.0@dev
- monolog/monolog: ^1.16
- phpunit/phpunit: ~4.7
Suggests
- aws/aws-sdk-php: Used to the AmazonS3Adapter
- monolog/monolog: Pass the logger around as if it was a blunt
This package is not auto-updated.
Last update: 2023-11-22 13:41:44 UTC
README
Filesystem是围绕文件系统的一个通用的PHP包装器,允许您将文件存储在几乎任何地方。它解决的问题是在开发过程中,您希望在磁盘上存储东西,然后部署应用程序到Heroku,现在您必须处理检查您是否在localhost上或在Heroku实例上的混乱代码。
功能
- 存储资产于
- 本地磁盘
- S3
- 即将推出更多
- 模拟文件系统用于测试
- 支持使用
psr/log
包进行日志记录
安装
composer require "dspacelabs/filesystem:0.1@dev"
配置
每个适配器都有自己的配置,我已经在适配器文件中尽力记录。使用源代码。
使用
<?php $adapter = new \Dspacelabs\Component\Filesystem\Adapter\LocalAdapter('/tmp'); $filesystem = new \Dspacelabs\Component\Filesystem\Filesystem($adapter); // Everything uses the `dspace` protocol, you can swap out different adapters // but the protocol will always stay the same. $handle = fopen('dspace://file.txt', 'w+'); fwrite($handle, 'testing'); fclose($handle);
$ cat /tmp/file.txt testing
有关更多使用示例,请查看测试目录。
测试
只需运行phpunit
即可运行所有测试。
phpunit
变更日志
查看CHANGELOG.md。
许可
查看LICENSE。