bootstrap80.php 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Polyfill\Uuid as p;
  11. if (!defined('UUID_VARIANT_NCS')) {
  12. define('UUID_VARIANT_NCS', 0);
  13. }
  14. if (!defined('UUID_VARIANT_DCE')) {
  15. define('UUID_VARIANT_DCE', 1);
  16. }
  17. if (!defined('UUID_VARIANT_MICROSOFT')) {
  18. define('UUID_VARIANT_MICROSOFT', 2);
  19. }
  20. if (!defined('UUID_VARIANT_OTHER')) {
  21. define('UUID_VARIANT_OTHER', 3);
  22. }
  23. if (!defined('UUID_TYPE_DEFAULT')) {
  24. define('UUID_TYPE_DEFAULT', 0);
  25. }
  26. if (!defined('UUID_TYPE_TIME')) {
  27. define('UUID_TYPE_TIME', 1);
  28. }
  29. if (!defined('UUID_TYPE_MD5')) {
  30. define('UUID_TYPE_MD5', 3);
  31. }
  32. if (!defined('UUID_TYPE_DCE')) {
  33. define('UUID_TYPE_DCE', 4); // Deprecated alias
  34. }
  35. if (!defined('UUID_TYPE_NAME')) {
  36. define('UUID_TYPE_NAME', 1); // Deprecated alias
  37. }
  38. if (!defined('UUID_TYPE_RANDOM')) {
  39. define('UUID_TYPE_RANDOM', 4);
  40. }
  41. if (!defined('UUID_TYPE_SHA1')) {
  42. define('UUID_TYPE_SHA1', 5);
  43. }
  44. if (!defined('UUID_TYPE_NULL')) {
  45. define('UUID_TYPE_NULL', -1);
  46. }
  47. if (!defined('UUID_TYPE_INVALID')) {
  48. define('UUID_TYPE_INVALID', -42);
  49. }
  50. if (!function_exists('uuid_create')) {
  51. function uuid_create(?int $uuid_type = \UUID_TYPE_DEFAULT): string { return p\Uuid::uuid_create((int) $uuid_type); }
  52. }
  53. if (!function_exists('uuid_generate_md5')) {
  54. function uuid_generate_md5(?string $uuid_ns, ?string $name): string { return p\Uuid::uuid_generate_md5((string) $uuid_ns, (string) $name); }
  55. }
  56. if (!function_exists('uuid_generate_sha1')) {
  57. function uuid_generate_sha1(?string $uuid_ns, ?string $name): string { return p\Uuid::uuid_generate_sha1((string) $uuid_ns, (string) $name); }
  58. }
  59. if (!function_exists('uuid_is_valid')) {
  60. function uuid_is_valid(?string $uuid): bool { return p\Uuid::uuid_is_valid((string) $uuid); }
  61. }
  62. if (!function_exists('uuid_compare')) {
  63. function uuid_compare(?string $uuid1, ?string $uuid2): int { return p\Uuid::uuid_compare((string) $uuid1, (string) $uuid2); }
  64. }
  65. if (!function_exists('uuid_is_null')) {
  66. function uuid_is_null(?string $uuid): bool { return p\Uuid::uuid_is_null((string) $uuid); }
  67. }
  68. if (!function_exists('uuid_type')) {
  69. function uuid_type(?string $uuid): int { return p\Uuid::uuid_type((string) $uuid); }
  70. }
  71. if (!function_exists('uuid_variant')) {
  72. function uuid_variant(?string $uuid): int { return p\Uuid::uuid_variant((string) $uuid); }
  73. }
  74. if (!function_exists('uuid_time')) {
  75. function uuid_time(?string $uuid): int { return p\Uuid::uuid_time((string) $uuid); }
  76. }
  77. if (!function_exists('uuid_mac')) {
  78. function uuid_mac(?string $uuid): string { return p\Uuid::uuid_mac((string) $uuid); }
  79. }
  80. if (!function_exists('uuid_parse')) {
  81. function uuid_parse(?string $uuid): string { return p\Uuid::uuid_parse((string) $uuid); }
  82. }
  83. if (!function_exists('uuid_unparse')) {
  84. function uuid_unparse(?string $uuid): string { return p\Uuid::uuid_unparse((string) $uuid); }
  85. }