File tree Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Expand file tree Collapse file tree 2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change 22All notable changes to this project will be documented in this file.
33This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
44
5+ ## [ 4.0.8] - 25 Mar 2018
6+ ### Added
7+ - work-around for missing ` config_path() ` function in Lumen.
8+
59## [ 4.0.7] - 25 Mar 2018
610### Added
711- optional dedicated cache store.
Original file line number Diff line number Diff line change @@ -21,22 +21,40 @@ class GeocoderService extends ServiceProvider
2121
2222 public function boot ()
2323 {
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 () {
2831 return (new ProviderAndDumperAggregator )
29- ->registerProvidersFromConfig (collect (config (' geocoder.providers ' )));
32+ ->registerProvidersFromConfig (collect (config (" geocoder.providers " )));
3033 });
3134 }
3235
3336 public function register ()
3437 {
35- $ this ->app ->alias (' Geocoder ' , Geocoder::class);
38+ $ this ->app ->alias (" Geocoder " , Geocoder::class);
3639 }
3740
3841 public function provides () : array
3942 {
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 );
4159 }
4260}
You can’t perform that action at this time.
0 commit comments