コード例 #1
0
 private function commonInitiate()
 {
     $this->_config_channel = GameManager::getChannel($this->_data["uid"]);
     $config_temp = new Zend_Config(array('database' => array('adapter' => $this->_config_channel->adapter, 'params' => $this->_config_channel->params)));
     $db_channel = GameManager::getDbConnection($config_temp, $this->_config_channel->dbname);
     $this->_db_channel = $db_channel;
     $config_temp = new Zend_Config(array('database' => array('adapter' => 'pdo_mysql', 'params' => array('host' => $this->_config_channel->params->host, 'dbname' => "information_schema", 'username' => $this->_config_channel->params->username, 'password' => $this->_config_channel->params->password))));
     $db_channel_schema = GameManager::getDbConnection($config_temp, $this->_config_channel->dbname . ".information_schema");
     $this->_db_channel_schema = $db_channel_schema;
     return $this;
 }
コード例 #2
0
 public static function getRegisterSetting()
 {
     $db_static = Zend_Registry::get('db_static');
     $db_users = Zend_Registry::get('db_users');
     $db_users_schema = Zend_Registry::get('db_users_schema');
     //check uid
     $user_total = $db_users_schema->fetchOne("select MAX(AUTO_INCREMENT) from TABLES where TABLE_NAME like '%user%'");
     $current_setting = GameManager::getChannel($user_total);
     if (!$current_setting) {
         //passed
         $data = array("data" => null, "status" => ReturnStatus::INTERNAL_SERVER_ERROR, "status_msg" => "Input Wrong Format [NOT FOUND AVAILABLE CHANNEL]");
         parent::sendResponse($data);
     }
     if (!($found = $db_users_schema->fetchRow("select * from TABLES where TABLE_NAME =? ", $current_setting->usertable))) {
         //passed
         $data = array("data" => null, "status" => ReturnStatus::INTERNAL_SERVER_ERROR, "status_msg" => "Server not ready for registration");
         parent::sendResponse($data);
     }
     return $current_setting;
 }