Révision e7101f36
Ajouté par Julien Enselme il y a environ 9 ans
drupal7/sites/all/modules/uuid/uuid.inc | ||
---|---|---|
166 | 166 |
|
167 | 167 |
/** |
168 | 168 |
* Generates a UUID v4 using PHP code. |
169 |
*
|
|
170 |
* Based on code from @see http://php.net/uniqid#65879 , but corrected.
|
|
169 |
* |
|
170 |
* Based on code from http://php.net/uniqid#65879, but corrected.
|
|
171 | 171 |
*/ |
172 | 172 |
function _uuid_generate_php() { |
173 | 173 |
// The field names refer to RFC 4122 section 4.1.2. |
... | ... | |
188 | 188 |
|
189 | 189 |
|
190 | 190 |
// This is wrapped in an if block to avoid conflicts with PECL's uuid_is_valid(). |
191 |
/** |
|
192 |
* Check that a string appears to be in the format of a UUID. |
|
193 |
* |
|
194 |
* @param $uuid |
|
195 |
* The string to test. |
|
196 |
* |
|
197 |
* @return |
|
198 |
* TRUE if the string is well formed. |
|
199 |
*/ |
|
200 | 191 |
if (!function_exists('uuid_is_valid')) { |
192 |
/** |
|
193 |
* Check that a string appears to be in the format of a UUID. |
|
194 |
* |
|
195 |
* @param $uuid |
|
196 |
* The string to test. |
|
197 |
* |
|
198 |
* @return |
|
199 |
* TRUE if the string is well formed. |
|
200 |
*/ |
|
201 | 201 |
function uuid_is_valid($uuid) { |
202 | 202 |
return preg_match('/^' . UUID_PATTERN . '$/', $uuid); |
203 | 203 |
} |
Formats disponibles : Unified diff
Update uuid 1.0-alpha5 1.0-alpha6