@@ -37,6 +37,6 @@ |
||
| 37 | 37 | // Get file stream from remote url |
| 38 | 38 | $resource = fopen($remoteUrl, 'r'); |
| 39 | 39 | |
| 40 | - return (bool)$this->filesystem->getAdapter()->writeStream($path, $resource, $config); |
|
| 40 | + return (bool) $this->filesystem->getAdapter()->writeStream($path, $resource, $config); |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -565,7 +565,7 @@ |
||
| 565 | 565 | * @param string $path |
| 566 | 566 | * @param \DateTimeInterface|int $expiration |
| 567 | 567 | * @param array $options |
| 568 | - * @return string |
|
| 568 | + * @return \OSS\Http\ResponseCore |
|
| 569 | 569 | * |
| 570 | 570 | * @throws \RuntimeException |
| 571 | 571 | */ |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | public function getUrl($path) |
| 92 | 92 | { |
| 93 | 93 | // if (!$this->has($path)) throw new FileNotFoundException($path.' not found'); |
| 94 | - return ($this->ssl ? 'https://' : 'http://') . ($this->isCname ? ($this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain) : $this->bucket . '.' . $this->endPoint) . '/' . ltrim($path, '/'); |
|
| 94 | + return ($this->ssl ? 'https://' : 'http://').($this->isCname ? ($this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain) : $this->bucket.'.'.$this->endPoint).'/'.ltrim($path, '/'); |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | protected function logErr($func, $e) |
| 312 | 312 | { |
| 313 | 313 | if ($this->debug) { |
| 314 | - Log::error($func . ": FAILED"); |
|
| 314 | + Log::error($func.": FAILED"); |
|
| 315 | 315 | Log::error($e->getMessage()); |
| 316 | 316 | } |
| 317 | 317 | } |
@@ -112,6 +112,7 @@ |
||
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * {@inheritdoc} |
| 115 | + * @param string $path |
|
| 115 | 116 | */ |
| 116 | 117 | public function getVisibility($path) |
| 117 | 118 | { |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function read($path) |
| 26 | 26 | { |
| 27 | 27 | $result = $this->readObject($path); |
| 28 | - $result['contents'] = (string)$result['raw_contents']; |
|
| 28 | + $result['contents'] = (string) $result['raw_contents']; |
|
| 29 | 29 | unset($result['raw_contents']); |
| 30 | 30 | return $result; |
| 31 | 31 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $contents = $dirObjects["objects"]; |
| 55 | 55 | |
| 56 | 56 | $result = array_map([$this, 'normalizeResponse'], $contents); |
| 57 | - $result = array_filter($result, function ($value) { |
|
| 57 | + $result = array_filter($result, function($value) { |
|
| 58 | 58 | return $value['path'] !== false; |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | */ |
| 164 | 164 | public function deleteDir($dirname) |
| 165 | 165 | { |
| 166 | - $dirname = rtrim($this->applyPathPrefix($dirname), '/') . '/'; |
|
| 166 | + $dirname = rtrim($this->applyPathPrefix($dirname), '/').'/'; |
|
| 167 | 167 | $dirObjects = $this->listDirObjects($dirname, true); |
| 168 | 168 | |
| 169 | 169 | if (count($dirObjects['objects']) > 0) { |
@@ -14,18 +14,18 @@ discard block |
||
| 14 | 14 | public function boot() |
| 15 | 15 | { |
| 16 | 16 | $appConfig = $this->app->get('config'); |
| 17 | - if(!$appConfig->has('filesystem.disks.aliyun')){ |
|
| 17 | + if (!$appConfig->has('filesystem.disks.aliyun')) { |
|
| 18 | 18 | $filesystemConfig = $appConfig->get('filesystem'); |
| 19 | - if($appConfig->has('aliyun-oss')){ |
|
| 19 | + if ($appConfig->has('aliyun-oss')) { |
|
| 20 | 20 | $filesystemConfig['disks']['aliyun'] = $appConfig->get('aliyun-oss'); |
| 21 | - }else{ |
|
| 21 | + } else { |
|
| 22 | 22 | $filesystemConfig['disks']['aliyun'] = require __DIR__.'/config/config.php'; |
| 23 | 23 | } |
| 24 | 24 | $filesystemConfig['disks']['aliyun']['type'] = AliyunOssDriver::class; |
| 25 | - $appConfig->set($filesystemConfig,'filesystem'); |
|
| 25 | + $appConfig->set($filesystemConfig, 'filesystem'); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - $this->app->bind('aliyun.oss.filesystem',function(){ |
|
| 28 | + $this->app->bind('aliyun.oss.filesystem', function() { |
|
| 29 | 29 | $adapter = $this->app->get('aliyun.oss.adapter'); |
| 30 | 30 | |
| 31 | 31 | $filesystem = new Filesystem($adapter, new Config(['disable_asserts' => true])); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | return $filesystem; |
| 35 | 35 | }); |
| 36 | 36 | |
| 37 | - $this->app->bind('aliyun.oss.adapter',function(){ |
|
| 37 | + $this->app->bind('aliyun.oss.adapter', function() { |
|
| 38 | 38 | $config = $this->app->make(AliyunOssConfig::class); |
| 39 | 39 | $client = $this->app->get(OssClient::class); |
| 40 | 40 | |
@@ -43,14 +43,14 @@ discard block |
||
| 43 | 43 | return $adapter; |
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | - $this->app->bind(AliyunOssConfig::class, function () { |
|
| 46 | + $this->app->bind(AliyunOssConfig::class, function() { |
|
| 47 | 47 | $config = $this->app->get('config')->get('aliyun-oss'); |
| 48 | 48 | $ossConfig = new AliyunOssConfig($config); |
| 49 | 49 | $ossConfig->checkRequired(); |
| 50 | 50 | return $ossConfig; |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - $this->app->bind(OssClient::class, function () { |
|
| 53 | + $this->app->bind(OssClient::class, function() { |
|
| 54 | 54 | $ossConfig = $this->app->get(AliyunOssConfig::class); |
| 55 | 55 | $ossClient = new OssClient( |
| 56 | 56 | $ossConfig->getAccessId(), |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | ); |
| 63 | 63 | return $ossClient; |
| 64 | 64 | }); |
| 65 | - $this->app->bind( 'aliyun.oss.client',OssClient::class); |
|
| 65 | + $this->app->bind('aliyun.oss.client', OssClient::class); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function register() |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $filesystemConfig = $appConfig->get('filesystem'); |
| 19 | 19 | if($appConfig->has('aliyun-oss')){ |
| 20 | 20 | $filesystemConfig['disks']['aliyun'] = $appConfig->get('aliyun-oss'); |
| 21 | - }else{ |
|
| 21 | + } else{ |
|
| 22 | 22 | $filesystemConfig['disks']['aliyun'] = require __DIR__.'/config/config.php'; |
| 23 | 23 | } |
| 24 | 24 | $filesystemConfig['disks']['aliyun']['type'] = AliyunOssDriver::class; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | if ($this->app->runningInConsole()) { |
| 25 | 25 | $this->publishes([ |
| 26 | - __DIR__ . '/config/config.php' => config_path('aliyun-oss.php'), |
|
| 26 | + __DIR__.'/config/config.php' => config_path('aliyun-oss.php'), |
|
| 27 | 27 | ], 'config'); |
| 28 | 28 | } |
| 29 | 29 | $this->mergeConfigFrom( |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | $this->app->make('filesystem') |
| 35 | - ->extend('aliyun', function ($app, array $appConfig) { |
|
| 35 | + ->extend('aliyun', function($app, array $appConfig) { |
|
| 36 | 36 | $config = $app->make(AliyunOssConfig::class, ['config' => $appConfig]); |
| 37 | 37 | $client = $app->get(OssClient::class); |
| 38 | 38 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function register() |
| 48 | 48 | { |
| 49 | - $this->app->singleton(AliyunOssConfig::class, function ($app, $params = []) { |
|
| 49 | + $this->app->singleton(AliyunOssConfig::class, function($app, $params = []) { |
|
| 50 | 50 | if (isset($params['config'])) { |
| 51 | 51 | $config = $params['config']; |
| 52 | 52 | } else { |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return $ossConfig; |
| 58 | 58 | }); |
| 59 | 59 | |
| 60 | - $this->app->singleton(OssClient::class, function ($app) { |
|
| 60 | + $this->app->singleton(OssClient::class, function($app) { |
|
| 61 | 61 | $ossConfig = $app->get(AliyunOssConfig::class); |
| 62 | 62 | $ossClient = new OssClient( |
| 63 | 63 | $ossConfig->getAccessId(), |