mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-02-14 07:08:40 +00:00
fix config handling
This commit is contained in:
parent
4cfc1820cd
commit
aa60c34188
|
|
@ -60,6 +60,8 @@ int main(int argc, char **argv)
|
||||||
// Load config
|
// Load config
|
||||||
FILE *in = fopen("config.json", "r");
|
FILE *in = fopen("config.json", "r");
|
||||||
if (in == NULL) {
|
if (in == NULL) {
|
||||||
|
printf("Couldn't open config.json\n");
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,12 @@ abstract class InstallAbstract extends ApplicationAbstract
|
||||||
$defaultAppLower = \strtolower($defaultApp);
|
$defaultAppLower = \strtolower($defaultApp);
|
||||||
|
|
||||||
$config = include __DIR__ . '/Templates/config.tpl.php';
|
$config = include __DIR__ . '/Templates/config.tpl.php';
|
||||||
|
|
||||||
\file_put_contents(__DIR__ . '/../config.php', $config);
|
\file_put_contents(__DIR__ . '/../config.php', $config);
|
||||||
|
|
||||||
|
$configJson = include __DIR__ . '/Templates/config.tpl.php';
|
||||||
|
\file_put_contents(__DIR__ . '/../config.json', \json_decode($configJson, \JSON_PRETTY_PRINT));
|
||||||
|
|
||||||
|
\unlink(__DIR__ . '/../config.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static function editHtaccessFile(RequestAbstract $request): void
|
protected static function editHtaccessFile(RequestAbstract $request): void
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
||||||
|
|
||||||
require_once __DIR__ . '/phpOMS/Autoloader.php';
|
require_once __DIR__ . '/phpOMS/Autoloader.php';
|
||||||
|
|
||||||
$config = require_once __DIR__ . '/config.php';
|
$config = \json_decode(\file_get_contents(__DIR__ . '/config.json'), true);
|
||||||
|
|
||||||
$App = new \WebApplication($config);
|
$App = new \WebApplication($config);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user