diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-07-28 11:45:35 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2008-07-28 11:45:35 +0000 |
| commit | 5455ef5767bfbc1ce4c6216bd08b6861d603ece9 (patch) | |
| tree | 57827fc08100df95c1225fca3904ac29de2e94bf /roundcubemail/program/include/rcube_config.php | |
| parent | 32a41c185173b2eb5e9a147bd8042fb9b6f10306 (diff) | |
Show appropriate error message if config files are missing
git-svn-id: https://svn.roundcube.net/trunk@1614 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_config.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_config.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/roundcubemail/program/include/rcube_config.php b/roundcubemail/program/include/rcube_config.php index 14316b8b8..db53fe7e1 100644 --- a/roundcubemail/program/include/rcube_config.php +++ b/roundcubemail/program/include/rcube_config.php @@ -27,6 +27,7 @@ class rcube_config { private $prop = array(); + private $errors = array(); /** @@ -50,12 +51,16 @@ class rcube_config ob_start(); // load main config file - include_once(INSTALL_PATH . 'config/main.inc.php'); - $this->prop = (array)$rcmail_config; + if (include(INSTALL_PATH . 'config/main.inc.php')) + $this->prop = (array)$rcmail_config; + else + $this->errors[] = 'main.inc.php was not found.'; // load database config - include_once(INSTALL_PATH . 'config/db.inc.php'); - $this->prop += (array)$rcmail_config; + if (include(INSTALL_PATH . 'config/db.inc.php')) + $this->prop += (array)$rcmail_config; + else + $this->errors[] = 'db.inc.php was not found.'; // load host-specific configuration $this->load_host_config(); @@ -222,6 +227,17 @@ class rcube_config return $domain; } + + + /** + * Getter for error state + * + * @return mixed Error message on error, False if no errors + */ + public function get_error() + { + return empty($this->errors) ? false : join("\n", $this->errors); + } } |
