本文整理汇总了PHP中DBUtils::get_uuid方法的典型用法代码示例。如果您正苦于以下问题:PHP DBUtils::get_uuid方法的具体用法?PHP DBUtils::get_uuid怎么用?PHP DBUtils::get_uuid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtils
的用法示例。
在下文中一共展示了DBUtils::get_uuid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
if (!empty($tmp)) {
$errorHTML .= "<p/>User Name already in use";
}
}
}
if (empty($user->userMail)) {
$errorHTML .= "<p/>Enter User Mail";
}
if (empty($user->userFirstname)) {
$errorHTML .= "<p/>Enter User First Name";
}
if (empty($user->userLastname)) {
$errorHTML .= "<p/>Enter User Last Name";
}
if (empty($user->password)) {
$user->setPassword(DBUtils::get_uuid());
}
if (empty($errorHTML)) {
if (empty($user->registerDate)) {
$user->setRegisterDate(time());
}
$user->updateInsertToDatabase(DBUtils::getConnection());
$bot->setUserId($user->userId);
$bot->updateInsertToDatabase(DBUtils::getConnection());
try {
$const = "v1.3_" . date("Ymd");
GameConstantUtil::setConstant("constant.bot.version", $const);
} catch (Exception $exc) {
error_log($exc->getMessage());
error_log($exc->getTraceAsString());
}
示例2: createGameUser
public static function createGameUser($fbUser, $accessToken)
{
$result = new FunctionResult();
$errors = array();
if (empty($fbUser) || empty($fbUser['id'])) {
array_push($errors, LanguageUtils::getText("LANG_FACEBOOK_USER_CREATE_ERROR_USER_EMPTY"));
$result->success = false;
$result->result = $errors;
unset($errors);
return $result;
}
if (empty($accessToken)) {
array_push($errors, LanguageUtils::getText("LANG_FACEBOOK_USER_CREATE_ERROR_TOKEN_EMPTY"));
$result->success = false;
$result->result = $errors;
unset($errors);
return $result;
}
$user = GameUsers::create();
$user->setActive(1);
$user->setFacebookId($fbUser['id']);
$user->setOauthToken($accessToken);
$user->setCoins(GameConstantUtil::getConstant(GameUsers::$CONSTANT_USER_FIRST_COIN));
if (isset($fbUser['username'])) {
$user->setUserName($fbUser['username']);
} else {
$user->setUserName($fbUser['id']);
}
if (isset($fbUser['first_name'])) {
$user->setUserFirstname($fbUser['first_name']);
}
if (isset($fbUser['last_name'])) {
$user->setUserLastname($fbUser['last_name']);
}
if (isset($fbUser['email'])) {
$user->setUserMail($fbUser['email']);
}
$time = time();
$user->setRegisterDate($time);
$user->setLastLoginDate($time);
$user->setLoginCount(1);
if (isset($fbUser['gender'])) {
if ($fbUser['gender'] == "male") {
$user->setGender(1);
} else {
if ($fbUser['gender'] == "female") {
$user->setGender(0);
}
}
}
if (isset($fbUser['birthday'])) {
$user->setBirtday($fbUser['birthday']);
$user->setBirthdayDate(DBUtils::facebookBirthDayConverter($fbUser['birthday']));
}
$user->setPassword(DBUtils::get_uuid());
$user->setUserXP(0);
$level = GameUserLevel::getUserLevel(0);
if (!empty($level)) {
$user->setUserLevelNumber($level->levelNumber);
}
$user->setWinGameCount(0);
$user->setLostGameCount(0);
$user->setWinCountQuitGame(0);
$user->setWinCountConnectionLostGame(0);
$user->setWinCountDoubleGame(0);
$user->setLostCountQuitGame(0);
$user->setLostCountConnectionLostGame(0);
$user->setLostCountDoubleGame(0);
$user->insertIntoDatabase(DBUtils::getConnection());
$result->success = true;
$result->result = $user;
Queue::updateUserImage($user->userId);
unset($user);
return $result;
}