diff --git a/composer.json b/composer.json index ddb841d..1078155 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "codeinc/assets-middleware", - "version": "2.0.4", + "version": "2.0.5", "description": "A PSR-15 middleware to server static assets (CSS, JS, images, etc.)", "homepage": "https://github.com/CodeIncHQ/AssetsMiddleware", "type": "library", @@ -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; } /**