Skip to content

Commit a5b8c4a

Browse files
committed
Add UUID extension
1 parent 0448f0d commit a5b8c4a

24 files changed

+1011
-0
lines changed

EXTENSIONS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,12 @@ MAINTENANCE: Maintained
512512
STATUS: Working
513513
SINCE: 8.5.0
514514
-------------------------------------------------------------------------------
515+
EXTENSION: uuid
516+
PRIMARY MAINTAINER Máté Kocsis <kocsismate@php.net> (2026 - 2026)
517+
MAINTENANCE: Maintained
518+
STATUS: Working
519+
SINCE: 8.6.0
520+
-------------------------------------------------------------------------------
515521
EXTENSION: zip
516522
PRIMARY MAINTAINER: Pierre-Alain Joye <pajoye@php.net> (2006 - 2011)
517523
Remi Collet <remi@php.net> (2013-2020)

ext/uuid/CREDITS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
uuid
2+
Máté Kocsis
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
X-Powered-By: PHP/%v
2+
Content-type: text/html; charset=UTF-8
3+
4+
object(Uuid\UuidV7)#%d (%d) {
5+
["uuid"]=>
6+
string(36) "%s-%s-%s-%s-%s"
7+
}

ext/uuid/benchmark/7_php_uuid.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
TEST_NAME="PHP UUID"
2+
TEST_ID=php_uuid
3+
TEST_WARMUP=20
4+
TEST_ITERATIONS=50
5+
TEST_REQUESTS=10
6+
7+
TEST_TYPE=micro
8+
TEST_FILE=config/test/7_php_uuid.php

ext/uuid/benchmark/7_php_uuid.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
for ($i = 0; $i < 10_000; $i++) {
4+
$uuid = Uuid\UuidV7::generate();
5+
}
6+
7+
var_dump($uuid);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
X-Powered-By: PHP/%v
2+
Content-type: text/html; charset=UTF-8
3+
4+
object(Symfony\Component\Uid\UuidV7)#%d (%d) {
5+
["uid":protected]=>
6+
string(36) "%s-%s-%s-%s-%s"
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
TEST_NAME="Symfony UUID"
2+
TEST_ID=symfony_uuid
3+
TEST_WARMUP=20
4+
TEST_ITERATIONS=50
5+
TEST_REQUESTS=10
6+
7+
TEST_TYPE=micro
8+
TEST_FILE=config/test/8_symfony_uuid.php
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
require_once __DIR__ . "/../../app/laravel/vendor/autoload.php";
4+
5+
for ($i = 0; $i < 10_000; $i++) {
6+
$uuid = new Symfony\Component\Uid\UuidV7();
7+
}
8+
9+
var_dump($uuid);
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
laravel_version="12.11.0" # https://github.com/laravel/laravel/releases
5+
laravel_dir="$PROJECT_ROOT/app/laravel"
6+
7+
if [[ -d "$laravel_dir" ]]; then
8+
echo "Laravel is already installed"
9+
exit
10+
fi
11+
12+
mkdir -p "$laravel_dir"
13+
14+
sudo docker run --rm \
15+
--volume $PROJECT_ROOT:/code \
16+
--user $(id -u):$(id -g) \
17+
setup bash -c "\
18+
set -e \
19+
[[ -n '$GITHUB_TOKEN' ]] && composer config --global github-oauth.github.com '$GITHUB_TOKEN'; \
20+
composer create-project laravel/laravel laravel $laravel_version --no-interaction --working-dir=/code/app && \
21+
cp /code/app/laravel.composer.lock /code/app/laravel/composer.lock && \
22+
composer config platform-check false --working-dir=/code/app/laravel && \
23+
composer config platform.php 8.2 --working-dir=/code/app/laravel && \
24+
composer install --classmap-authoritative --no-interaction --working-dir=/code/app/laravel"
25+
26+
sed -i "s/'lottery' => \\[2, 100\\],/'lottery' => \\[0, 100\\],/g" $laravel_dir/config/session.php
27+
#sed -i "s#error_reporting(-1);#//error_reporting(-1);#g" $laravel_dir/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php
28+
29+
sed -i "s/if (\\\\PHP_VERSION_ID >= 80300) {/if (\\\\PHP_VERSION_ID > 80300 || (\\\\PHP_VERSION_ID === 80300 \&\& \\\\PHP_EXTRA_VERSION !== '-dev')) {/g" "$laravel_dir/vendor/symfony/polyfill-php83/bootstrap.php"
30+
sed -i "s/if (\\\\PHP_VERSION_ID >= 80300) {/if (\\\\PHP_VERSION_ID > 80300 || (\\\\PHP_VERSION_ID === 80300 \&\& \\\\PHP_EXTRA_VERSION !== '-dev')) {/g" "$laravel_dir/vendor/symfony/polyfill-php83/bootstrap81.php"
31+
sed -i "s/if (\\\\PHP_VERSION_ID >= 80400) {/if (\\\\PHP_VERSION_ID > 80400 || (\\\\PHP_VERSION_ID === 80400 \&\& \\\\PHP_EXTRA_VERSION !== '-dev')) {/g" "$laravel_dir/vendor/symfony/polyfill-php84/bootstrap.php"
32+
sed -i "s/if (\\\\PHP_VERSION_ID >= 80400) {/if (\\\\PHP_VERSION_ID > 80400 || (\\\\PHP_VERSION_ID === 80400 \&\& \\\\\PHP_EXTRA_VERSION !== '-dev')) {/g" "$laravel_dir/vendor/symfony/polyfill-php84/bootstrap82.php"
33+
sed -i "s/if (\\\\PHP_VERSION_ID >= 80500) {/if (\\\\PHP_VERSION_ID > 80500 || (\\\\PHP_VERSION_ID === 80500 \&\& \\\\PHP_EXTRA_VERSION !== '-dev')) {/g" "$laravel_dir/vendor/symfony/polyfill-php85/bootstrap.php"
34+
35+
sudo chmod -R 777 "$laravel_dir/storage"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
X-Powered-By: PHP/%v
2+
Content-type: text/html; charset=UTF-8
3+
4+
object(Ramsey\Uuid\Lazy\LazyUuidFromString)#%d (%d) {
5+
["unwrapped":"Ramsey\Uuid\Lazy\LazyUuidFromString":private]=>
6+
NULL
7+
["uuid":"Ramsey\Uuid\Lazy\LazyUuidFromString":private]=>
8+
string(36) "%s-%s-%s-%s-%s"
9+
}

0 commit comments

Comments
 (0)