예제 #1
0
 public function setConfigFolder($configFolder)
 {
     if (!$configFolder) {
         throw new \Exception('No config folder path!');
     }
     $realFolder = realpath($configFolder);
     if ($realFolder && is_dir($realFolder) && is_readable($realFolder)) {
         $this->configArray = array();
         $this->configFolder = $realFolder . DIRECTORY_SEPARATOR;
         $ns = $this->app['namespaces'];
         if (is_array($ns)) {
             Autoloader::registerNamespaces($ns);
         }
     }
 }
예제 #2
0
 public function setConfigFolder($configFolder)
 {
     if (!$configFolder) {
         throw new \Exception('Configuration folder path is empty!');
     }
     $realPath = realpath($configFolder);
     if ($realPath != false && is_dir($realPath) && is_readable($realPath)) {
         $this->_configArray = [];
         $this->_configFolder = $realPath . DIRECTORY_SEPARATOR;
         $namespaces = $this->app['namespaces'];
         if (is_array($namespaces)) {
             Autoloader::registerNamespaces($namespaces);
         }
     } else {
         throw new \Exception('Config directory read error: ' . $configFolder, 500);
     }
 }