}
/**
- * Generates a universal / unique identifier for a task.
- *
- * This is NOT something that we expect to be able to parse into a
- * calendar and an event id.
- *
- * @return string A nice unique string (should be 255 chars or less).
- */
- public function generateUID()
- {
- return date('YmdHis') . '.'
- . substr(str_pad(base_convert(microtime(), 10, 36), 16, uniqid(mt_rand()), STR_PAD_LEFT), -16)
- . '@' . $GLOBALS['conf']['server']['name'];
- }
-
- /**
* Renames a calendar.
*
* @param string $from The current name of the calendar.
/* If the event did not have a UID before, we need to give
* it one. */
if (empty($row['event_uid'])) {
- $row['event_uid'] = $this->generateUID();
+ $row['event_uid'] = (string)new Horde_Support_Guid;
/* Save the new UID for data integrity. */
$query = 'UPDATE ' . $this->_params['table'] . ' SET event_uid = ? WHERE event_id = ?';
if ($event->getUID()) {
$uid = $event->getUID();
} else {
- $uid = $this->generateUID();
+ $uid = (string)new Horde_Support_Guid;
$event->setUID($uid);
}