/**
  * @param string $name
  * @return array
  */
 protected function getConfig($name)
 {
     if ($this->config === null) {
         $this->config = ConfigFileLoader::loadPhp(Config::getString('hyperframework.db.config_path', 'db.php'));
     }
     if (isset($this->config[$name])) {
         return $this->config[$name];
     }
     if ($name === null) {
         return $this->config;
     }
     throw new ConfigException("Database connection config '{$name}' does not exist.");
 }
예제 #2
0
 protected function setUp()
 {
     Config::set('hyperframework.app_root_path', dirname(__DIR__));
     DbClient::execute(ConfigFileLoader::loadData('init.sql'));
     DbClient::setEngine(null);
 }