/**
  * Bootstrap the UUID service.
  *
  * @return void
  */
 public function boot()
 {
     $this->loadTranslationsFrom(__DIR__ . '../Lang', '');
     Validator::extend('uuid', function ($attribute, $value, $parameters) {
         return \Uuid::isValid($value);
     });
 }
Beispiel #2
0
 /**
  * @covers Rhumsaa\Uuid\Uuid::isValid
  */
 public function testIsValidTooLong()
 {
     $valid = Uuid::isValid('ff6f8cb0-c57da-51e1-9b21-0800200c9a66');
     $this->assertFalse($valid);
 }
db_select_db(DB, $con);
$admin = new administration();
$wmsView = '';
//parse request parameter
//make all parameters available as upper case
foreach ($_REQUEST as $key => $val) {
    $_REQUEST[strtoupper($key)] = $val;
}
//example mapbender uuid: 2494d033-ccdd-cdd7-71c6-3e3c195e1d85
//cb567df4-57da-449a-be74-821903a59d45
//validate request params
if (isset($_REQUEST['ID']) & $_REQUEST['ID'] != "") {
    //validate uuid
    $testMatch = $_REQUEST["ID"];
    $uuid = new Uuid($testMatch);
    $isUuid = $uuid->isValid();
    if (!$isUuid) {
        echo 'Id: <b>' . $testMatch . '</b> is not a valid mapbender uuid.<br/>';
        die;
    }
    $recordId = $testMatch;
    $testMatch = NULL;
}
//
if ($_REQUEST['OUTPUTFORMAT'] == "iso19139") {
    //Initialize XML document
    $iso19139Doc = new DOMDocument('1.0');
    $iso19139Doc->encoding = 'UTF-8';
} else {
    echo 'outputFormat: <b>' . $_REQUEST['OUTPUTFORMAT'] . '</b> is not set or valid.<br/>';
    die;
 public static function isuuid($uuid)
 {
     $obj = new Uuid($uuid);
     return $obj->isValid();
 }