Ejemplo n.º 1
0
 /**
  * Set configs for database connection
  * 
  * @param array $config
  * @return void
  */
 public function setConfig($config)
 {
     if (!isset($config['source_directory']) || $config['source_directory'] == '') {
         $sourceDir = PathManager::getDataDirectory() . '/' . $this->_driver;
         if (!file_exists($sourceDir)) {
             if (@mkdir($sourceDir) == false) {
                 throw new Exception('Failed to create data source directory "' . $sourceDir . '". Please check permission of data directory');
             }
         }
         $config['source_directory'] = $sourceDir;
     }
     if (!isset($config['source_file']) || $config['source_file'] == '') {
         $config['source_file'] = $this->_defaultSourceName;
     }
     $this->_config = $config;
 }