private function create_database() { // Try to create a database named by $post_data->database try { $createDatabse_stament = $this->adapter->createStatement('CREATE DATABASE IF NOT EXISTS `' . $this->config['database'] . '` CHARACTER SET = utf8 COLLATE = utf8_general_ci'); $rs = $createDatabse_stament->execute(); parent::__construct(new Adapter($this->config)); if ($this->adapter->getCurrentSchema() == $this->config['database']) { $this->tables = $this->getTableNames(); $local_db_config = new Config(array('db' => $this->config), true); $this->generateConfigFile($local_db_config); } } catch (\Exception $e) { throw $e; } }
/** * @param Adapter $adapter */ public function __construct(Adapter $adapter) { parent::__construct($adapter); }