private function __construct() { \GF\Loader::registerNamespace('GF', dirname(__FILE__ . DIRECTORY_SEPARATOR)); \GF\Loader::registerAutoLoad(); $this->_config = \GF\Config::getInstance(); //if($this->_config->getConfigFolder() == null){ // $this->_config->setConfigFolder('../config'); //} }
private function __construct() { set_exception_handler(array($this, '_exceptionHandler')); \GF\Loader::registerNamespace('GF', dirname(__FILE__) . DIRECTORY_SEPARATOR); \GF\Loader::registerAutoload(); $this->config = \GF\Config::getInstance(); if ($this->config->getConfigFolder() == null) { $this->setConfigFolder('../Config'); } }
/** * @param $configFolder * @throws \Exception */ public function setConfigFolder($configFolder) { if (!$configFolder) { throw new \Exception('Empty config folder path'); } $_configFolder = realpath($configFolder); if ($_configFolder != FALSE && is_dir($_configFolder) && is_readable($_configFolder)) { $this->_configArray = []; $this->_configFolder = $_configFolder . DIRECTORY_SEPARATOR; $ns = $this->app['namespaces']; if (is_array($ns)) { \GF\Loader::registerNamespaces($ns); } } else { throw new \Exception('Config directory read error:' . $configFolder); } }