Example #1
0
File: base.php Project: antz29/base
 public final function __construct()
 {
     $envs = file_exists(CONFIG_ROOT . 'envs.php') ? require CONFIG_ROOT . 'envs.php' : [];
     $default = isset($envs['_default']) ? $envs['_default'] : 'shared';
     unset($envs['_default']);
     $env = $this->getEnvironment()->detectEnvironment($envs, $default);
     $this->_config = new Config\Config(CONFIG_ROOT . 'app.php', $env);
     date_default_timezone_set('Europe/London');
     $partial_path = isset($this->_config->partials) ? $this->_config->partials : 'partials';
     Template::setPartialPath($partial_path);
     if ($this->_config->error_handling) {
         ini_set('display_errors', false);
         set_error_handler(array($this, 'errorHandler'));
         set_exception_handler(array($this, 'exceptionHandler'));
         register_shutdown_function(array($this, 'shutdownHandler'));
     }
 }