/** * * @throws UndefinedHttpException */ public function __construct() { parent::__construct(); if (!isset($_COOKIE)) { throw new UndefinedHttpException("COOKIE"); } else { $this->setAll($_COOKIE); } }
/** * * @throws UndefinedHttpException */ public function __construct() { parent::__construct(); if (!isset($_SESSION)) { throw new UndefinedHttpException("SESSION"); } else { $this->setAll($_SESSION); } }
/** * * @param string $config_path[optional] * * @throws \RuntimeException */ public function __construct($config_path = '../app/config') { parent::__construct(); $this->_config_path = rtrim($config_path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; $this->_template_path = __DIR__ . DIRECTORY_SEPARATOR . "config_template" . DIRECTORY_SEPARATOR; if (is_dir($this->getPath()) && $this->generateDefault()) { $this->loadAll(); } else { throw new \RuntimeException("Undefined directory {$this->_config_path} to load configurations!"); } }