PHP Classes

File: bin/uuidgen

Recommend this page to a friend!
  Classes of Chun-Sheng, Li   PHP UUID Generator V1   bin/uuidgen   Download  
File: bin/uuidgen
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP UUID Generator V1
Generate a RFC 4122-compliant unique identifier
Author: By
Last change:
Date: 1 year ago
Size: 612 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php

$autoload
= array_filter([
   
__DIR__ . '/../../autoload.php',
   
__DIR__ . '/../vendor/autoload.php',
   
__DIR__ . '/vendor/autoload.php'
], function ($file) {
    return
file_exists($file);
});


if (!
count($autoload)) {
   
fwrite(
       
STDERR,
       
'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
       
' composer install' . PHP_EOL . PHP_EOL .
       
'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
   
);
    die(
1);
}

require
reset($autoload);

$uuid = new \UUID\UUID();
printf("%s\n", $uuid->v1());