ets / document-storage
此包已被弃用且不再维护。未建议替代包。
提供与各种文档存储服务的交互实现
0.5.3
2015-01-13 10:34 UTC
Requires
- php: >=5.3.3
- aws/aws-sdk-php: ~2.7
- ets/echosign-bundle: ~0.2
Requires (Dev)
- phpspec/phpspec: ~2.1
- phpunit/phpunit: >=3.7,<5.0
README
提供与各种云存储服务的交互实现。
安装
composer require ets/document-storage
存储适配器
所有存储适配器都实现了 ETS\DocumentStorage\Storage
接口
ETS\DocumentStorage\Adapter\Storage\Composite
ETS\DocumentStorage\Adapter\Storage\EchoSign
ETS\DocumentStorage\Adapter\Storage\Filesystem
ETS\DocumentStorage\Adapter\Storage\S3
存储文档
$docUrl = $storage->store('body of a doc', 'docName');
该方法返回文档的 URL。
获取文档的 URL
$docUrl = $storage->getUrl('docName');
如果文档不存在,将抛出 ETS\DocumentStorage\Exception\DocumentNotFoundException