|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Freyo\Flysystem\QcloudCOSv5; |
|
4
|
|
|
|
|
5
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\CDN; |
|
6
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\CloudInfinite; |
|
7
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\GetFederationToken; |
|
8
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\GetFederationTokenV3; |
|
9
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\GetUrl; |
|
10
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\PutRemoteFile; |
|
11
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\PutRemoteFileAs; |
|
12
|
|
|
use Freyo\Flysystem\QcloudCOSv5\Plugins\TCaptcha; |
|
13
|
|
|
use Illuminate\Support\ServiceProvider as LaravelServiceProvider; |
|
|
|
|
|
|
14
|
|
|
use Laravel\Lumen\Application as LumenApplication; |
|
|
|
|
|
|
15
|
|
|
use League\Flysystem\Filesystem; |
|
16
|
|
|
use Qcloud\Cos\Client; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Class ServiceProvider. |
|
20
|
|
|
*/ |
|
21
|
|
|
class ServiceProvider extends LaravelServiceProvider |
|
22
|
|
|
{ |
|
23
|
|
|
/** |
|
24
|
|
|
* Bootstrap any application services. |
|
25
|
|
|
* |
|
26
|
|
|
* @return void |
|
27
|
|
|
*/ |
|
28
|
|
|
public function boot() |
|
29
|
|
|
{ |
|
30
|
|
|
if ($this->app instanceof LumenApplication) { |
|
31
|
|
|
$this->app->configure('filesystems'); |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
|
|
$this->app->make('filesystem') |
|
35
|
|
|
->extend('cosv5', function ($app, $config) { |
|
36
|
|
|
$client = new Client($config); |
|
37
|
|
|
$flysystem = new Filesystem(new Adapter($client, $config), $config); |
|
38
|
|
|
|
|
39
|
|
|
$flysystem->addPlugin(new PutRemoteFile()); |
|
40
|
|
|
$flysystem->addPlugin(new PutRemoteFileAs()); |
|
41
|
|
|
$flysystem->addPlugin(new GetUrl()); |
|
42
|
|
|
$flysystem->addPlugin(new CDN()); |
|
43
|
|
|
$flysystem->addPlugin(new TCaptcha()); |
|
44
|
|
|
$flysystem->addPlugin(new GetFederationToken()); |
|
45
|
|
|
$flysystem->addPlugin(new GetFederationTokenV3()); |
|
46
|
|
|
$flysystem->addPlugin(new CloudInfinite()); |
|
47
|
|
|
|
|
48
|
|
|
return $flysystem; |
|
49
|
|
|
}); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Register any application services. |
|
54
|
|
|
* |
|
55
|
|
|
* @return void |
|
56
|
|
|
*/ |
|
57
|
|
|
public function register() |
|
58
|
|
|
{ |
|
59
|
|
|
$this->mergeConfigFrom( |
|
60
|
|
|
__DIR__.'/filesystems.php', 'filesystems' |
|
61
|
|
|
); |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths