| | |
| | | class rcube_config |
| | | { |
| | | private $prop = array(); |
| | | private $errors = array(); |
| | | |
| | | |
| | | /** |
| | |
| | | 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(); |
| | |
| | | // set PHP error logging according to config |
| | | if ($this->prop['debug_level'] & 1) { |
| | | ini_set('log_errors', 1); |
| | | ini_set('error_log', $this->prop['log_dir'] . '/errors'); |
| | | |
| | | if ($this->prop['log_driver'] == 'syslog') { |
| | | ini_set('error_log', 'syslog'); |
| | | } else { |
| | | ini_set('error_log', $this->prop['log_dir'].'/errors'); |
| | | } |
| | | } |
| | | if ($this->prop['debug_level'] & 4) { |
| | | ini_set('display_errors', 1); |
| | |
| | | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | } |