示例#1
0
 /**
  * @internal Initializes the urand or uuid resource
  *
  *
  */
 static function initialize()
 {
     if (self::$init) {
         return;
     }
     if (function_exists('uuid_make')) {
         @uuid_create(&uuid::$uobject);
         self::$method = self::USE_PECL_MAKE;
     } elseif (function_exists('uuid_create')) {
         @uuid_create(&Uuid::$uobject);
         self::$method = self::USE_PECL_CREATE;
     } else {
         Uuid::$urand = @fopen('/dev/urandom', 'rb');
         self::$method = self::USE_PHP;
     }
     self::$init = true;
 }