From b6c15a38f0065a8b58ccd5cdb660d201391d9d23 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Tue, 4 Jul 2006 07:36:09 +0000 Subject: [PATCH] reload default configuration if config.inc.php is removed --- ChangeLog | 2 ++ libraries/Config.class.php | 13 ++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b76230fb..b51505e87 100755 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ $Source$ 2006-07-04 Sebastian Mendel * js\querywindow.js, libraries\footer.inc.php: renamed JavaScript function refreshLeft() to refreshNavigation() + * libraries/Config.class.php: reload default configuration if config.inc.php + is removed 2006-07-03 Sebastian Mendel * index.php, js\querywindow.js, querywindow.php, libraries\common.lib.php, diff --git a/libraries/Config.class.php b/libraries/Config.class.php index f5b378e75..a4aae21ce 100644 --- a/libraries/Config.class.php +++ b/libraries/Config.class.php @@ -293,11 +293,13 @@ class PMA_Config */ function __wakeup() { - if (file_exists($this->getSource()) && $this->source_mtime !== filemtime($this->getSource()) + if (! $this->checkConfigSource() + || $this->source_mtime !== filemtime($this->getSource()) || $this->default_source_mtime !== filemtime($this->default_source) - || $this->error_config_file || $this->error_config_default_file) { + || $this->error_config_file + || $this->error_config_default_file) { $this->settings = array(); - $this->load($this->getSource()); + $this->load(); $this->checkSystem(); } @@ -424,6 +426,11 @@ class PMA_Config */ function checkConfigSource() { + if (! $this->getSource()) { + // no configuration file set at all + return false; + } + if (! file_exists($this->getSource())) { // do not trigger error here // https://sf.net/tracker/?func=detail&aid=1370269&group_id=23067&atid=377408