Skip to content

Commit

Permalink
default endpoint and base_url
Browse files Browse the repository at this point in the history
  • Loading branch information
dyaskur committed Jul 6, 2020
1 parent 7a3f430 commit 21e26d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"require": {
"php": ">=5.5.9",
"php": ">=5.6.0",
"illuminate/support": "*",
"illuminate/filesystem": "^5.1|^6.0|^7.0",
"league/flysystem-cached-adapter": "^1.0",
Expand All @@ -40,7 +40,7 @@
}
},
"require-dev": {
"phpunit/phpunit": ">=4.8"
"phpunit/phpunit": "^5.0"
},
"minimum-stability": "dev"
}
14 changes: 9 additions & 5 deletions src/GoogleCloudStorageServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ public function boot()
$factory->extend(
'gcs',
function ($app, $config) {
$config['endpoint'] = $config['endpoint'] ?? "https://storage.googleapis.com";
$config['base_url'] = $config['base_url'] ?? "https://storage.googleapis.com";
$config['region'] = $config['region'] ?? "none";

$s3Config = $this->formatS3Config($config);
$s3Config['region'] = $s3Config['region'] ?? 'none';
$root = $s3Config['root'] ?? null;
$root = $s3Config['root'] ?? null;

$options = $config['options'] ?? [];

Expand Down Expand Up @@ -56,7 +59,7 @@ protected function formatS3Config(array $config)
/**
* Adapt the filesystem implementation.
*
* @param FilesystemInterface $filesystem
* @param FilesystemInterface $filesystem
*
* @return Filesystem
*/
Expand All @@ -68,8 +71,8 @@ protected function adapt(FilesystemInterface $filesystem)
/**
* Create a Flysystem instance with the given adapter.
*
* @param AdapterInterface $adapter
* @param array $config
* @param AdapterInterface $adapter
* @param array $config
*
* @return FilesystemInterface
*/
Expand All @@ -93,4 +96,5 @@ public function register()
{
//
}

}

0 comments on commit 21e26d5

Please sign in to comment.