本文整理汇总了PHP中UUID::Generate方法的典型用法代码示例。如果您正苦于以下问题:PHP UUID::Generate方法的具体用法?PHP UUID::Generate怎么用?PHP UUID::Generate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UUID
的用法示例。
在下文中一共展示了UUID::Generate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Create
public static function Create($member_username, $password, $member_longname, $user_URLName, $member_email, $member_emailcode = null)
{
$CurrentTenant = Tenant::GetCurrent();
if ($CurrentTenant == null) {
return null;
}
$passwordSalt = \UUID::Generate();
$passwordHash = hash("sha512", $passwordSalt . $password);
global $MySQL;
$query = "INSERT INTO " . System::GetConfigurationValue("Database.TablePrefix") . "Users (user_TenantID, user_LoginID, user_PasswordHash, user_PasswordSalt, user_DisplayName, user_URLName, user_EmailAddress, user_EmailConfirmationCode, user_RegistrationTimestamp, user_RegistrationIPAddress) VALUES (" . $CurrentTenant->ID . ", " . "'" . $MySQL->real_escape_string($member_username) . "', " . "'" . $MySQL->real_escape_string($passwordHash) . "', " . "'" . $MySQL->real_escape_string($passwordSalt) . "', " . "'" . $MySQL->real_escape_string($member_longname) . "', " . "'" . $MySQL->real_escape_string($user_URLName) . "', " . "'" . $MySQL->real_escape_string($member_email) . "', " . ($member_emailcode == null ? "NULL" : "'" . $MySQL->real_escape_string($member_emailcode) . "'") . ", " . "NOW()," . "'" . $_SERVER["REMOTE_ADDR"] . "'" . ")";
$result = $MySQL->query($query);
if ($MySQL->errno == 0) {
$id = $MySQL->insert_id;
$user = User::GetByID($id, true);
MarketResourceTransaction::Create(MarketResourceTransaction::GetInitialResources(), $user, null, "InitialResourceAllotmentForUser:" . $user->ID, null);
return $user;
}
return null;
}