mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 13:35:54 +00:00
wip
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user