Browse Source

add multi-host config support

main
ghost 7 months ago
parent
commit
cf4496bc55
  1. 4
      .gitignore
  2. 0
      config/example.json
  3. 7
      src/server.php

4
.gitignore vendored

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

0
example/config.json → config/example.json

7
src/server.php

@ -11,9 +11,12 @@ $config = json_decode( @@ -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 = [];

Loading…
Cancel
Save