private function __construct() { \myFrame\Loader::registerNamespace('myFrame', dirname(__FILE__) . DIRECTORY_SEPARATOR); \myFrame\Loader::registerAutoLoad(); $this->_config = \myFrame\Config::getInstance(); if ($this->_config->getConfigFolder() == null) { $this->setConfigFolder('../config'); } }
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 = array(); $this->_configFolder = $_configFolder . DIRECTORY_SEPARATOR; $ns = $this->app['namespaces']; if (is_array($ns)) { \myFrame\Loader::registerNamespaces($ns); } } else { throw new \Exception('Config directory read error: ' . $configFolder); } }