示例#1
0
 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');
     //}
 }
示例#2
0
 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');
     }
 }
示例#3
0
 /**
  * @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);
     }
 }