File tree 2 files changed +29
-7
lines changed
2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 2
2
All notable changes to this project will be documented in this file.
3
3
This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
4
4
5
+ ## [ 4.0.8] - 25 Mar 2018
6
+ ### Added
7
+ - work-around for missing ` config_path() ` function in Lumen.
8
+
5
9
## [ 4.0.7] - 25 Mar 2018
6
10
### Added
7
11
- optional dedicated cache store.
Original file line number Diff line number Diff line change @@ -21,22 +21,40 @@ class GeocoderService extends ServiceProvider
21
21
22
22
public function boot ()
23
23
{
24
- $ configPath = __DIR__ . '/../../config/geocoder.php ' ;
25
- $ this ->publishes ([$ configPath => config_path ('geocoder.php ' )], 'config ' );
26
- $ this ->mergeConfigFrom ($ configPath , 'geocoder ' );
27
- $ this ->app ->singleton ('geocoder ' , function () {
24
+ $ configPath = __DIR__ . "/../../config/geocoder.php " ;
25
+ $ this ->publishes (
26
+ [$ configPath => $ this ->configPath ("geocoder.php " )],
27
+ "config "
28
+ );
29
+ $ this ->mergeConfigFrom ($ configPath , "geocoder " );
30
+ $ this ->app ->singleton ("geocoder " , function () {
28
31
return (new ProviderAndDumperAggregator )
29
- ->registerProvidersFromConfig (collect (config (' geocoder.providers ' )));
32
+ ->registerProvidersFromConfig (collect (config (" geocoder.providers " )));
30
33
});
31
34
}
32
35
33
36
public function register ()
34
37
{
35
- $ this ->app ->alias (' Geocoder ' , Geocoder::class);
38
+ $ this ->app ->alias (" Geocoder " , Geocoder::class);
36
39
}
37
40
38
41
public function provides () : array
39
42
{
40
- return ['geocoder ' ];
43
+ return ["geocoder " ];
44
+ }
45
+
46
+ protected function configPath (string $ path = "" ) : string
47
+ {
48
+ if (function_exists ("config_path " )) {
49
+ return config_path ($ path );
50
+ }
51
+
52
+ $ pathParts = [
53
+ app ()->basePath (),
54
+ "config " ,
55
+ trim ($ path , "/ " ),
56
+ ];
57
+
58
+ return implode ("/ " , $ pathParts );
41
59
}
42
60
}
You can’t perform that action at this time.
0 commit comments