diff --git a/src/Core/Config/Util/ConfigFileManager.php b/src/Core/Config/Util/ConfigFileManager.php index c7e63a63b..3a4ebb893 100644 --- a/src/Core/Config/Util/ConfigFileManager.php +++ b/src/Core/Config/Util/ConfigFileManager.php @@ -257,13 +257,14 @@ class ConfigFileManager // When reading the config file too fast, we get a wrong filesize, "clearstatcache" prevents that clearstatcache(true, $filename); $content = fread($configStream, filesize($filename)); - // Event truncating the whole content wouldn't automatically rewind the stream, - // so we need to do it manually - rewind($configStream); if (!$content) { throw new ConfigFileException(sprintf('Cannot read file %s', $filename)); } + // Event truncating the whole content wouldn't automatically rewind the stream, + // so we need to do it manually + rewind($configStream); + $dataArray = eval('?>' . $content); // Merge the new content into the existing file based config cache and use it @@ -279,7 +280,6 @@ class ConfigFileManager $data = $configCache->getDataBySource(Cache::SOURCE_DATA); $encodedData = ConfigFileTransformer::encode($data); - if (!$encodedData) { throw new ConfigFileException('config source cannot get encoded'); } diff --git a/src/Core/Config/Util/ConfigFileTransformer.php b/src/Core/Config/Util/ConfigFileTransformer.php index 4eaafe061..ac4990df1 100644 --- a/src/Core/Config/Util/ConfigFileTransformer.php +++ b/src/Core/Config/Util/ConfigFileTransformer.php @@ -34,7 +34,6 @@ class ConfigFileTransformer $categories = array_keys($data); foreach ($categories as $category) { - if (is_null($data[$category])) { $dataString .= "\t'$category' => null," . PHP_EOL; continue;