| Total Complexity | 2 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class BaiduBosServiceProvider extends ServiceProvider |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * Bootstrap any application services. |
||
| 15 | * |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function boot() |
||
| 19 | { |
||
| 20 | Storage::extend('bos', function ($app, $config) { |
||
| 21 | $config += [ |
||
| 22 | 'disable_asserts' => true, |
||
| 23 | 'case_sensitive' => true, |
||
| 24 | 'options' => [], |
||
| 25 | ]; |
||
| 26 | |||
| 27 | $client = new Client([ |
||
| 28 | 'access_key' => $config['access_key'], |
||
| 29 | 'secret_key' => $config['secret_key'], |
||
| 30 | 'bucket' => $config['bucket'], |
||
| 31 | 'region' => $config['region'], |
||
| 32 | 'options' => $config['options'] |
||
| 33 | ]); |
||
| 34 | |||
| 35 | return new Filesystem(new BaiduBosAdapter($client), [ |
||
| 36 | 'disable_asserts' => $config['disable_asserts'], |
||
| 37 | 'case_sensitive' => $config['case_sensitive'], |
||
| 38 | ]); |
||
| 39 | }); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Register the service provider. |
||
| 44 | * |
||
| 45 | * @return void |
||
| 46 | */ |
||
| 47 | public function register() |
||
| 49 | } |
||
| 50 | } |
||
| 51 |