@@ 8-53 (lines=46) @@ | ||
5 | use Illuminate\Support\ServiceProvider; |
|
6 | use limenet\S3BucketStreamZip\S3BucketStreamZip; |
|
7 | ||
8 | class AwsZipStreamServiceProvider extends ServiceProvider |
|
9 | { |
|
10 | /** |
|
11 | * Indicates if loading of the provider is deferred. |
|
12 | * |
|
13 | * @var bool |
|
14 | */ |
|
15 | protected $defer = true; |
|
16 | ||
17 | /** |
|
18 | * Bootstrap the application services. |
|
19 | * |
|
20 | * @return void |
|
21 | */ |
|
22 | public function boot() |
|
23 | { |
|
24 | } |
|
25 | ||
26 | /** |
|
27 | * Register the application services. |
|
28 | * |
|
29 | * @return void |
|
30 | */ |
|
31 | public function register() |
|
32 | { |
|
33 | $this->app->bind(S3BucketStreamZip::class, function ($_) { |
|
34 | return new S3BucketStreamZip([ |
|
35 | 'key' => config('services.s3.key'), |
|
36 | 'secret' => config('services.s3.secret'), |
|
37 | 'region' => config('services.s3.region'), |
|
38 | 'version' => config('services.s3.version'), |
|
39 | ]); |
|
40 | }); |
|
41 | } |
|
42 | ||
43 | /** |
|
44 | * Get the services provided by the provider. |
|
45 | * |
|
46 | * @return array |
|
47 | */ |
|
48 | public function provides() |
|
49 | { |
|
50 | return [S3BucketStreamZip::class]; |
|
51 | } |
|
52 | } |
|
53 |
@@ 7-52 (lines=46) @@ | ||
4 | ||
5 | use Illuminate\Support\ServiceProvider; |
|
6 | ||
7 | class AwsZipStreamServiceProvider extends ServiceProvider |
|
8 | { |
|
9 | /** |
|
10 | * Indicates if loading of the provider is deferred. |
|
11 | * |
|
12 | * @var bool |
|
13 | */ |
|
14 | protected $defer = true; |
|
15 | ||
16 | /** |
|
17 | * Bootstrap the application services. |
|
18 | * |
|
19 | * @return void |
|
20 | */ |
|
21 | public function boot() |
|
22 | { |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * Register the application services. |
|
27 | * |
|
28 | * @return void |
|
29 | */ |
|
30 | public function register() |
|
31 | { |
|
32 | $this->app->bind(S3BucketStreamZip::class, function ($_) { |
|
33 | return new S3BucketStreamZip([ |
|
34 | 'key' => config('services.s3.key'), |
|
35 | 'secret' => config('services.s3.secret'), |
|
36 | 'region' => config('services.s3.region'), |
|
37 | 'version' => config('services.s3.version'), |
|
38 | ]); |
|
39 | }); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * Get the services provided by the provider. |
|
44 | * |
|
45 | * @return array |
|
46 | */ |
|
47 | public function provides() |
|
48 | { |
|
49 | return [S3BucketStreamZip::class]; |
|
50 | } |
|
51 | } |
|
52 |