public static function load_configuration() { try { $stmt = JxBotDB::$db->prepare('SELECT opt_key, opt_value FROM opt'); $stmt->execute(); $rows = $stmt->fetchAll(PDO::FETCH_NUM); if (count($rows) == 0) { throw new Exception('Not properly installed.'); } foreach ($rows as $row) { JxBotConfig::$config[$row[0]] = $row[1]; } } catch (Exception $err) { JxBotConfig::run_installer(); } }