diff --git a/.gitignore b/.gitignore index 8d4386c..d94da66 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,9 @@ vendor #Coverage report coverage +#Package Docs +docs + #build related gulp node_modules diff --git a/README.md b/README.md index 0e06223..08f91cf 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,14 @@ eloquent-external-storage [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Code Climate][code-climate-image]][code-climate-url] [![Dependency Status][dependency-status-image]][dependency-status-url] -> Adds external storage to an eloquent model. +> Adds external storage capabilities to an eloquent model. +## Features + +- Save/retrieve model-related content to an external storage using `setContent()`, `getContent()` methods on the eloquent model. + Now you can move all that binary data out of the database without having to move a finger. - Storage supports different drivers, currently `file` and `Amazon AWS S3` are implemented -- Different models can have different storage methods, configurations +- Different models can implement different storage drivers, separate configurations - Storage drivers can be updated on the fly. ## Installation @@ -113,10 +117,19 @@ Both options have the ability to generate a code coverage report in different fo ### Testing AWS S3 Driver -- Valid AWS S3 credentials need to be provided via `tests/.env` file, see `tests/.env.example` as an example. -- Travis CI integration is performed by passing encrypted credentials in travis.yml (valid only for inakianduaga/eloquent-external-storage repo). +- **Locally:** Valid AWS S3 credentials need to be provided via `tests/.env` file, see `tests/.env.example` as an example. +- **CI**: Travis CI integration is performed by passing encrypted credentials in travis.yml (valid only for inakianduaga/eloquent-external-storage repo). - [Amazon S3 testing in Travis CI](http://milesj.me/blog/read/amazon-s3-testing-travis-ci) +### Tests Coverage report + +- `gulp test --generateCoverage=coverageHtml` to generate html code coverage report (under `./coverage` folder) + +## Documentation generation + +- The package code documentation can be generated by running `gulp docs`, which generates the docs in the `./docs` folder + + [travis-url]: https://travis-ci.org/inakianduaga/eloquent-external-storage [travis-image]: https://travis-ci.org/inakianduaga/eloquent-external-storage.svg?branch=master diff --git a/apigen.phar b/apigen.phar new file mode 100644 index 0000000..1a25754 Binary files /dev/null and b/apigen.phar differ diff --git a/src/Drivers/AbstractDriver.php b/src/Drivers/AbstractDriver.php index a766d31..a8ff51b 100644 --- a/src/Drivers/AbstractDriver.php +++ b/src/Drivers/AbstractDriver.php @@ -5,6 +5,9 @@ use Illuminate\Config\Repository as ConfigService; use Carbon\Carbon; +/** + * Common baseline for all drivers + */ abstract class AbstractDriver implements DriverInterface { /** diff --git a/src/Drivers/AwsS3.php b/src/Drivers/AwsS3.php index 39bc3b8..b29e0c0 100644 --- a/src/Drivers/AwsS3.php +++ b/src/Drivers/AwsS3.php @@ -47,7 +47,7 @@ public function setConfigKey($key) /** * {@inheritDoc} * - * http://stackoverflow.com/questions/13686316/grabbing-contents-of-object-from-s3-via-php-sdk-2 + * @link http://stackoverflow.com/questions/13686316/grabbing-contents-of-object-from-s3-via-php-sdk-2 */ public function fetch($path) { @@ -68,7 +68,7 @@ public function fetch($path) { /** * {@inheritDoc} * - * http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpPHP.html + * @link http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpPHP.html */ public function store($content) { diff --git a/src/Services/ExtensionGuesser.php b/src/Services/ExtensionGuesser.php index 3803269..cd2aeac 100644 --- a/src/Services/ExtensionGuesser.php +++ b/src/Services/ExtensionGuesser.php @@ -33,7 +33,7 @@ public function guess($string) } /** - * http://stackoverflow.com/questions/5144583/getting-filename-or-deleting-file-using-file-handle + * @link http://stackoverflow.com/questions/5144583/getting-filename-or-deleting-file-using-file-handle * * @param $handler *