baruica / document-storage
提供与各种文档存储服务交互的实现
0.6.1
2016-05-29 13:02 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpspec/phpspec: ^2.5
README
提供各种存储服务的适配器。
安装
通过composer
composer require baruica/document-storage
存储适配器
所有存储适配器都实现了 DocumentStorage\Storage
接口
DocumentStorage\Adapter\Storage\Composite
DocumentStorage\Adapter\Storage\Filesystem
DocumentStorage\Adapter\Storage\S3
存储文档
$docUrl = $storage->store('body of a doc', 'docName');
该方法返回文档的URL。
获取文档的URL
$docUrl = $storage->getUrl('docName');
如果文档不存在,将抛出 DocumentStorage\Exception\DocumentNotFound
异常