add multi-host config support

This commit is contained in:
ghost 2024-04-30 16:24:29 +03:00
parent eb52f6c2d9
commit cf4496bc55
3 changed files with 9 additions and 4 deletions

6
.gitignore vendored
View File

@ -1,3 +1,5 @@
/vendor/
/composer.lock
/config.json
/config/*
!/config/example.json
/composer.lock

View File

@ -11,9 +11,12 @@ $config = json_decode(
file_get_contents(
__DIR__ .
DIRECTORY_SEPARATOR . '..'.
DIRECTORY_SEPARATOR . 'config.json'
DIRECTORY_SEPARATOR . 'config'.
DIRECTORY_SEPARATOR . (
isset($argv[1]) ? $argv[1] : 'example.json'
)
)
);
); if (!$config) exit;
// Init session
$session = [];