1 | <?php |
||
2 | /** |
||
3 | * @package php-tmdb\laravel |
||
4 | * @author Mark Redeman <[email protected]> |
||
5 | * @copyright (c) 2014, Mark Redeman |
||
6 | */ |
||
7 | namespace Tmdb\Laravel; |
||
8 | |||
9 | use Illuminate\Support\ServiceProvider; |
||
10 | |||
11 | class TmdbServiceProviderLaravel extends ServiceProvider { |
||
12 | |||
13 | /** |
||
14 | * Bootstrap the application events. |
||
15 | * |
||
16 | * @return void |
||
17 | */ |
||
18 | public function boot() |
||
19 | { |
||
20 | $this->publishes([ |
||
21 | $this->defaultConfig() => config_path('tmdb.php'), |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
22 | ]); |
||
23 | } |
||
24 | |||
25 | /** |
||
26 | * Register the service provider. |
||
27 | * |
||
28 | * @return void |
||
29 | */ |
||
30 | public function register() |
||
31 | { |
||
32 | $this->setupConfiguration(); |
||
33 | |||
34 | $this->app->bind('Tmdb\Laravel\Adapters\EventDispatcherAdapter', 'Tmdb\Laravel\Adapters\EventDispatcherLaravel'); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get the TMDB configuration from the config repository |
||
39 | * |
||
40 | * @return array |
||
41 | */ |
||
42 | public function config() |
||
43 | { |
||
44 | return $this->app['config']->get('tmdb'); |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Setup configuration |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | private function setupConfiguration() |
||
53 | { |
||
54 | $config = $this->defaultConfig(); |
||
55 | $this->mergeConfigFrom($config, 'tmdb'); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Returns the default configuration path |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | private function defaultConfig() |
||
64 | { |
||
65 | return __DIR__ . '/config/tmdb.php'; |
||
66 | } |
||
67 | } |
||
68 |