From 5fea3ce7e0c1d9078f37bf9d98ddd562178a06fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ndor?= Date: Fri, 28 May 2021 09:12:15 +0200 Subject: [PATCH] config file parameter --- record.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/record.php b/record.php index 4112644..e8082c0 100644 --- a/record.php +++ b/record.php @@ -3,6 +3,9 @@ /* -------------------------------------------------------------- */ +// Options +$opts = getopt('c::'); + // Basic functions function logger($tabs = 1, $txt, $lvl = 1, $exit = false) { @@ -38,7 +41,7 @@ if (!function_exists('json_decode')) logger(1, 'json_decode is required but not available', 1, true); // Settings -if (!file_exists(__DIR__.'/config.json')) +if (!file_exists(isset($opts['c']) ? $opts['c'] : __DIR__.'/config.json')) logger(1, 'Config file not found', 1, true); if (!$_set = @json_decode(@file_get_contents(__DIR__.'/config.json'))) logger(1, 'Unable to load or parse configuration file', 1, true);