From ed1e6fd015b487edabd3c616a813371e538f2b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jakes=CC=8C?= Date: Tue, 13 Aug 2019 08:46:23 +0200 Subject: [PATCH] Throw exception when metadata cache not writable [MAILPOET-2269] --- lib/Doctrine/MetadataCache.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/MetadataCache.php b/lib/Doctrine/MetadataCache.php index 3819114d1a..3631758930 100644 --- a/lib/Doctrine/MetadataCache.php +++ b/lib/Doctrine/MetadataCache.php @@ -29,7 +29,11 @@ class MetadataCache extends CacheProvider { } protected function doSave($id, $data, $lifeTime = 0) { - file_put_contents($this->getFilename($id), serialize($data)); + $filename = $this->getFilename($id); + $result = @file_put_contents($filename, serialize($data)); + if ($result === false) { + throw new \RuntimeException("Error while writing to '$filename'"); + } } protected function doDelete($id) {