baruica / document-storage
Provides implementations to interact with various document storage services
Installs: 19
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/baruica/document-storage
Requires
- php: ^7.0
Requires (Dev)
- phpspec/phpspec: ^2.5
README
Provides adapters to various storage services.
Install
Via composer
composer require baruica/document-storage
Storage adapters
All storage adapters implement the DocumentStorage\Storage
interface:
DocumentStorage\Adapter\Storage\Composite
DocumentStorage\Adapter\Storage\Filesystem
DocumentStorage\Adapter\Storage\S3
To store a document:
$docUrl = $storage->store('body of a doc', 'docName');
The method returns the document's url.
To get the document's url
$docUrl = $storage->getUrl('docName');
If the document doesn't exist, it will throw a DocumentStorage\Exception\DocumentNotFound