reload default configuration if config.inc.php is removed

This commit is contained in:
Sebastian Mendel
2006-07-04 07:36:09 +00:00
parent 9bd00d3dff
commit b6c15a38f0
2 changed files with 12 additions and 3 deletions

View File

@@ -8,6 +8,8 @@ $Source$
2006-07-04 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2006-07-04 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* js\querywindow.js, libraries\footer.inc.php: renamed JavaScript function * js\querywindow.js, libraries\footer.inc.php: renamed JavaScript function
refreshLeft() to refreshNavigation() refreshLeft() to refreshNavigation()
* libraries/Config.class.php: reload default configuration if config.inc.php
is removed
2006-07-03 Sebastian Mendel <cybot_tm@users.sourceforge.net> 2006-07-03 Sebastian Mendel <cybot_tm@users.sourceforge.net>
* index.php, js\querywindow.js, querywindow.php, libraries\common.lib.php, * index.php, js\querywindow.js, querywindow.php, libraries\common.lib.php,

View File

@@ -293,11 +293,13 @@ class PMA_Config
*/ */
function __wakeup() 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->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->settings = array();
$this->load($this->getSource()); $this->load();
$this->checkSystem(); $this->checkSystem();
} }
@@ -424,6 +426,11 @@ class PMA_Config
*/ */
function checkConfigSource() function checkConfigSource()
{ {
if (! $this->getSource()) {
// no configuration file set at all
return false;
}
if (! file_exists($this->getSource())) { if (! file_exists($this->getSource())) {
// do not trigger error here // do not trigger error here
// https://sf.net/tracker/?func=detail&aid=1370269&group_id=23067&atid=377408 // https://sf.net/tracker/?func=detail&aid=1370269&group_id=23067&atid=377408