This commit is contained in:
dongwei 2019-03-18 18:08:23 +08:00
parent 4daf42ffd4
commit ee2cdf45a3

View File

@ -29,14 +29,16 @@ class BaseServiceProvider extends ServiceProvider
protected function setupConfig() protected function setupConfig()
{ {
$source = realpath(__DIR__ . '/../../config/rpc.php'); $source = realpath(__DIR__ . '/../../config/rpc.php');
$this->app->configure('rpc');
if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { // if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) {
$this->publishes([$source => config_path('rpc.php')], 'rpc'); // $this->publishes([$source => config_path('rpc.php')], 'rpc');
} elseif ($this->app instanceof LumenApplication) { // } elseif ($this->app instanceof LumenApplication) {
$this->app->configure('rpc'); // $this->app->configure('rpc');
} // }
// var_dump($this->app instanceof LumenApplication); // false
// exit();
$this->mergeConfigFrom($source, 'rpc'); $this->mergeConfigFrom($source, 'rpc');
} }
public function register() public function register()