This commit is contained in:
Marcel Pociot
2020-04-24 16:10:38 +02:00
19 changed files with 1873 additions and 1562 deletions

View File

@@ -18,6 +18,8 @@ class AppServiceProvider extends ServiceProvider
public function register()
{
$this->loadConfigurationFile();
$this->app->singleton(LoopInterface::class, function () {
return LoopFactory::create();
});
@@ -26,4 +28,23 @@ class AppServiceProvider extends ServiceProvider
return new RequestLogger($app->make(Browser::class), $app->make(CliRequestLogger::class));
});
}
protected function loadConfigurationFile()
{
$configFile = implode(DIRECTORY_SEPARATOR, [
$_SERVER['HOME'],
'.expose',
'config.php'
]);
if (file_exists($configFile)) {
config()->set('expose', require_once $configFile);
return;
}
$localConfigFile = getcwd() . DIRECTORY_SEPARATOR . '.expose.php';
if (file_exists($localConfigFile)) {
config()->set('expose', require_once $localConfigFile);
}
}
}