From f3d35577e2acae673ff87243aec7ddb5b5568724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Fabr=C3=A9gat?= Date: Mon, 8 Oct 2018 19:58:18 +0200 Subject: [PATCH] reverting to sha1 as dir keys --- composer.json | 3 +-- src/AssetsMiddleware.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index ddb841d..fd445b1 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,7 @@ "codeinc/psr7-responses": "^2", "matthiasmullie/minify": "^1.3", "codeinc/media-types": "^1.0", - "enshrined/svg-sanitize": "^0.8.2", - "ramsey/uuid": "^3.8" + "enshrined/svg-sanitize": "^0.8.2" }, "require-dev": { "phpunit/phpunit": "^7", diff --git a/src/AssetsMiddleware.php b/src/AssetsMiddleware.php index a3d462a..342c307 100644 --- a/src/AssetsMiddleware.php +++ b/src/AssetsMiddleware.php @@ -36,7 +36,6 @@ use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Server\MiddlewareInterface; use Psr\Http\Server\RequestHandlerInterface; -use Ramsey\Uuid\Uuid; /** @@ -111,7 +110,7 @@ public function addAssetsDirectory(string $directoryPath, string $directoryKey = if ($directoryKey !== null && empty($directoryKey)) { throw new EmptyDirectoryKeyException($directoryPath); } - $this->assetsDirectories[$directoryKey ?? Uuid::uuid4()->toString()] = $directoryPath; + $this->assetsDirectories[$directoryKey ?? hash('sha1', $directoryPath)] = $directoryPath; } /**