Allow running without config file.

Piotr Pawlow [2017-03-19 19:18:22]
Allow running without config file.
Filename
auth.php
diff --git a/auth.php b/auth.php
index ccb2859..6a62130 100644
--- a/auth.php
+++ b/auth.php
@@ -15,7 +15,7 @@ if ($lockfile === FALSE) die("Cannot open lock file\n");
 if (!flock($lockfile, LOCK_EX)) die("Cannot acquire exclisive lock\n");

 $options = getopt("c:");
-$config = load_config(@$options['c']);
+if (isset($options['c'])) $config = load_config($options['c']); else $config = new stdClass();
 $config_default = load_config(__DIR__.'/config_default.json');

 foreach($config_default as $k => $v) if (!isset($config->{$k})) $config->{$k} = $v;
ViewGit