diff --git a/src/Caching/Storages/FileStorage.php b/src/Caching/Storages/FileStorage.php index 1e143add..77ad5d63 100644 --- a/src/Caching/Storages/FileStorage.php +++ b/src/Caching/Storages/FileStorage.php @@ -31,9 +31,9 @@ class FileStorage implements Nette\Caching\IStorage * delete* = try unlink, if fails (on NTFS) { lock(EX), truncate, close, unlink } else close (on ext3) */ - /** @internal cache file structure */ + /** @internal cache file structure: meta-struct size + serialized meta-struct + data */ private const - META_HEADER_LEN = 28, // 22b signature + 6b meta-struct size + serialized meta-struct + data + META_HEADER_LEN = 6, // meta structure: array of META_TIME = 'time', // timestamp META_SERIALIZED = 'serialized', // is content serialized? @@ -205,8 +205,8 @@ public function write(string $key, $data, array $dp): void $meta[self::META_SERIALIZED] = true; } - $head = serialize($meta) . '?>'; - $head = '