UUID instead of GUID

This commit is contained in:
Michael 2018-09-26 20:03:46 +00:00
parent 9ec30010c5
commit 60b0759b50
13 changed files with 40 additions and 47 deletions

View file

@ -314,7 +314,7 @@ class Event extends BaseObject
Addon::callHooks('event_updated', $event['id']);
} else {
$event['guid'] = defaults($arr, 'guid', System::createGUID(32));
$event['guid'] = defaults($arr, 'guid', System::UUID());
// New event. Store it.
DBA::insert('event', $event);

View file

@ -1205,7 +1205,7 @@ class Item extends BaseObject
} elseif (!empty($item['uri'])) {
$guid = self::guidFromUri($item['uri'], $prefix_host);
} else {
$guid = System::createGUID(32, hash('crc32', $prefix_host));
$guid = System::UUID(hash('crc32', $prefix_host));
}
return $guid;
@ -2359,7 +2359,7 @@ class Item extends BaseObject
public static function newURI($uid, $guid = "")
{
if ($guid == "") {
$guid = System::createGUID(32);
$guid = System::UUID();
}
return self::getApp()->get_baseurl() . '/object/' . $guid;
@ -2686,7 +2686,7 @@ class Item extends BaseObject
}
if ($contact['network'] != Protocol::FEED) {
$datarray["guid"] = System::createGUID(32);
$datarray["guid"] = System::UUID();
unset($datarray["plink"]);
$datarray["uri"] = self::newURI($contact['uid'], $datarray["guid"]);
$datarray["parent-uri"] = $datarray["uri"];
@ -3115,7 +3115,7 @@ class Item extends BaseObject
$objtype = $item['resource-id'] ? ACTIVITY_OBJ_IMAGE : ACTIVITY_OBJ_NOTE ;
$new_item = [
'guid' => System::createGUID(32),
'guid' => System::UUID(),
'uri' => self::newURI($item['uid']),
'uid' => $item['uid'],
'contact-id' => $item_contact_id,

View file

@ -46,7 +46,7 @@ class Mail
return -2;
}
$guid = System::createGUID(32);
$guid = System::UUID();
$uri = 'urn:X-dfrn:' . System::baseUrl() . ':' . local_user() . ':' . $guid;
$convid = 0;
@ -73,7 +73,7 @@ class Mail
$recip_handle = (($contact['addr']) ? $contact['addr'] : $contact['nick'] . '@' . $recip_host);
$sender_handle = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);
$conv_guid = System::createGUID(32);
$conv_guid = System::UUID();
$convuri = $recip_handle . ':' . $conv_guid;
$handles = $recip_handle . ';' . $sender_handle;
@ -171,7 +171,7 @@ class Mail
$subject = L10n::t('[no subject]');
}
$guid = System::createGUID(32);
$guid = System::UUID();
$uri = 'urn:X-dfrn:' . System::baseUrl() . ':' . local_user() . ':' . $guid;
$me = Probe::uri($replyto);
@ -180,7 +180,7 @@ class Mail
return -2;
}
$conv_guid = System::createGUID(32);
$conv_guid = System::UUID();
$recip_handle = $recipient['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(), '://') + 3);

View file

@ -495,7 +495,7 @@ class User
$spubkey = $sres['pubkey'];
$insert_result = DBA::insert('user', [
'guid' => System::createGUID(32),
'guid' => System::UUID(),
'username' => $username,
'password' => $new_password_encoded,
'email' => $email,