From c31db96593994a650ca457c120ff898a5b35a513 Mon Sep 17 00:00:00 2001 From: Mubashar Date: Tue, 24 May 2016 17:40:13 +0500 Subject: [PATCH 1/2] Updated AWS3provider and added option to add pem certificate while creating connection --- .gitignore | 1 + readme.md | 9 +++++++++ src/Vinelab/Cdn/Providers/AwsS3Provider.php | 3 +++ src/config/cdn.php | 11 +++++++++++ 4 files changed, 24 insertions(+) diff --git a/.gitignore b/.gitignore index e3b009b..d0d70e8 100755 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.lock .DS_Store docs +.idea \ No newline at end of file diff --git a/readme.md b/readme.md index e041293..716c7cd 100755 --- a/readme.md +++ b/readme.md @@ -81,6 +81,7 @@ You can find it at `config/cdn.php` 'version' => 'latest', 'region' => '', + 'buckets' => [ 'my-backup-bucket' => '*', ] @@ -138,6 +139,14 @@ Set the CDN URL: 'url' => 'https://s3.amazonaws.com', ``` +##### HTTP + +Set the HTTP parameters: + +```php +'http' => '['verify' => path-to-your-pem-certificate-file]', +``` + ##### Bypass To load your LOCAL assets for testing or during development, set the `bypass` option to `true`: diff --git a/src/Vinelab/Cdn/Providers/AwsS3Provider.php b/src/Vinelab/Cdn/Providers/AwsS3Provider.php index 9142c91..bcae54c 100755 --- a/src/Vinelab/Cdn/Providers/AwsS3Provider.php +++ b/src/Vinelab/Cdn/Providers/AwsS3Provider.php @@ -28,6 +28,7 @@ * @property string $acl * @property string $cloudfront * @property string $cloudfront_url + * @property string $http * * @author Mahmoud Zalt */ @@ -48,6 +49,7 @@ class AwsS3Provider extends Provider implements ProviderInterface 'version' => null, 'region' => null, 'buckets' => null, + 'http' => null, 'acl' => 'public-read', 'cloudfront' => [ 'use' => false, @@ -158,6 +160,7 @@ public function connect() $this->setS3Client(new S3Client([ 'version' => $this->supplier['version'], 'region' => $this->supplier['region'], + 'http' => $this->supplier['http'] ] ) ); diff --git a/src/config/cdn.php b/src/config/cdn.php index a5a345d..db5e0f1 100755 --- a/src/config/cdn.php +++ b/src/config/cdn.php @@ -54,6 +54,17 @@ */ 'threshold' => 10, + /* + |-------------------------------------------------------------------------- + | HTTP Parameters + |-------------------------------------------------------------------------- + | + | Set your HTTP parameters. + | Add you .pem certificate to your request. + | + */ + 'http' => [], + /* |-------------------------------------------------------------------------- | CDN Supported Providers From e6f971b494bc34ce2946183032ab56a1502d0cfb Mon Sep 17 00:00:00 2001 From: Mubashar Date: Fri, 27 May 2016 00:06:20 +0500 Subject: [PATCH 2/2] Removed .idea from .gitignore --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d0d70e8..e248e37 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ /vendor composer.lock .DS_Store -docs -.idea \ No newline at end of file +docs \ No newline at end of file