Skip to content

Commit 8ce9d78

Browse files
authored
Merge pull request #427 from dotkernel/issue-426
Issue #426: Switch from `UUID4` to `UUID7`
2 parents 5d3dbd4 + c6cee12 commit 8ce9d78

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Dotkernel API is a PHP skeleton app for building REST APIs using [Laminas](https://github.com/laminas) and [Mezzio](https://github.com/mezzio) components and implements standards like PSR-3, PSR-4, PSR-7, PSR-11 and PSR-15.
44

5-
Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications, and is based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github.com/ezimuel/zend-expressive-api).
5+
Dotkernel API is an alternative for legacy Laminas API Tools (formerly Apigility) applications and is based on Enrico Zimuel's [Zend Expressive API - Skeleton example](https://github.com/ezimuel/zend-expressive-api).
66

77
> Live [demo](https://api.dotkernel.net/).
88
@@ -47,7 +47,7 @@ composer install
4747

4848
> **Do not enable development mode in production!**
4949
50-
If you're installing the project for development, you should **enable** development mode, by running:
50+
If you're installing the project for development, you should **enable** development mode by running:
5151

5252
```shell
5353
composer development-enable
@@ -59,17 +59,17 @@ You can **disable** development mode by running:
5959
composer development-disable
6060
```
6161

62-
You can **check** development status by running:
62+
You can **check** the development status by running:
6363

6464
```shell
6565
composer development-status
6666
```
6767

6868
### Prepare config files
6969

70-
* duplicate `config/autoload/cors.local.php.dist` as `config/autoload/cors.local.php` <- if your API will be consumed by another application, make sure configure the `allowed_origins`
70+
* duplicate `config/autoload/cors.local.php.dist` as `config/autoload/cors.local.php` <- if your API is consumed by another application, make sure configure the `allowed_origins`
7171
* duplicate `config/autoload/local.php.dist` as `config/autoload/local.php`
72-
* **optional**: in order to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php` <- this creates a new in-memory database that your tests will run on
72+
* **optional**: to run/create tests, duplicate `config/autoload/local.test.php.dist` as `config/autoload/local.test.php` <- this creates a new in-memory database that your tests will run on
7373

7474
### Setup database
7575

@@ -120,7 +120,7 @@ More details on how fixtures work can be found in `dotkernel/dot-data-fixtures`
120120

121121
### Mail configuration
122122

123-
If your application will send emails, you must configure an outgoing mail server under `config/autoload/mail.global.php`.
123+
If your application sends emails, you must configure an outgoing mail server under `config/autoload/mail.global.php`.
124124

125125
### Test the installation
126126

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"mezzio/mezzio-hal": "^2.10.1",
7575
"mezzio/mezzio-helpers": "^5.18",
7676
"mezzio/mezzio-problem-details": "^1.15.0",
77+
"ramsey/uuid": "^4.5.0",
7778
"ramsey/uuid-doctrine": "^2.1.0",
7879
"roave/psr-container-doctrine": "^5.2.2",
7980
"symfony/filesystem": "^7.2.0",

src/Core/src/App/src/Entity/AbstractEntity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class AbstractEntity implements ArraySerializableInterface, EntityInter
2222

2323
public function __construct()
2424
{
25-
$this->uuid = Uuid::uuid4();
25+
$this->uuid = Uuid::uuid7();
2626
}
2727

2828
public function getUuid(): UuidInterface

src/User/src/Service/UserAvatarService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ protected function createFileName(string $fileType): string
9494
{
9595
return sprintf(
9696
'avatar-%s.%s',
97-
Uuid::uuid4()->toString(),
97+
Uuid::uuid7()->toString(),
9898
self::EXTENSIONS[$fileType]
9999
);
100100
}

0 commit comments

Comments
 (0)