mirror of
https://github.com/Karaka-Management/oms-OnlineResourceWatcher.git
synced 2026-01-27 06:58:42 +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
|
||||
FILE *in = fopen("config.json", "r");
|
||||
if (in == NULL) {
|
||||
printf("Couldn't open config.json\n");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -107,8 +107,12 @@ abstract class InstallAbstract extends ApplicationAbstract
|
|||
$defaultAppLower = \strtolower($defaultApp);
|
||||
|
||||
$config = include __DIR__ . '/Templates/config.tpl.php';
|
||||
|
||||
\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
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ declare(strict_types=1);
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user