From a3e3341d60eef9df0970e93cec7823010221f76b Mon Sep 17 00:00:00 2001 From: Uladzimir Tsykun Date: Tue, 23 Apr 2024 13:55:23 +0200 Subject: [PATCH] More fixes for #246 --- src/Package/Updater.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Package/Updater.php b/src/Package/Updater.php index c76c9a1d..4edf9aba 100644 --- a/src/Package/Updater.php +++ b/src/Package/Updater.php @@ -99,12 +99,8 @@ public function __construct( ErrorHandler::register(); } - public function setSerializerCachePath(string $serializerCachePath): void + public function setSerializerCachePath(?string $serializerCachePath): void { - if (!mkdir($serializerCachePath, true) && !is_dir($serializerCachePath)) { - throw new \RuntimeException(sprintf('Directory "%s" was not created', $serializerCachePath)); - } - $this->serializerCachePath = $serializerCachePath; } @@ -906,6 +902,9 @@ private function prepareReadme(string $readme, ?string $host = null, ?string $ow $config->set('Attr.EnableID', true); $config->set('Attr.AllowedFrameTargets', ['_blank']); if ($this->serializerCachePath !== null) { + if (!is_dir($this->serializerCachePath)) { + @mkdir($this->serializerCachePath, recursive: true); + } $config->set('Cache.SerializerPath', $this->serializerCachePath); }