@@ -31,9 +31,9 @@ class FileStorage implements Nette\Caching\IStorage
3131	 * delete* = try unlink, if fails (on NTFS) { lock(EX), truncate, close, unlink } else close (on ext3) 
3232	 */ 
3333
34- 	/** @internal cache file structure */ 
34+ 	/** @internal cache file structure: meta-struct size + serialized meta-struct + data  */ 
3535	private  const 
36- 		META_HEADER_LEN  = 28 ,  // 22b signature + 6b meta-struct size + serialized meta-struct + data 
36+ 		META_HEADER_LEN  = 6 , 
3737	// meta structure: array of 
3838		META_TIME  = 'time ' , // timestamp 
3939		META_SERIALIZED  = 'serialized ' , // is content serialized? 
@@ -205,8 +205,8 @@ public function write(string $key, $data, array $dp): void
205205			$ metaself ::META_SERIALIZED ] = true ;
206206		}
207207
208- 		$ headserialize ($ meta .  ' ?> ' 
209- 		$ head' <?php //netteCache[01] '  .  str_pad ((string ) strlen ($ head6 , '0 ' , STR_PAD_LEFT ) . $ head
208+ 		$ headserialize ($ meta
209+ 		$ headstr_pad ((string ) strlen ($ head6 , '0 ' , STR_PAD_LEFT ) . $ head
210210		$ headLenstrlen ($ head
211211
212212		do  {
@@ -321,9 +321,9 @@ protected function readMetaAndLock(string $file, int $lock): ?array
321321
322322		flock ($ handle$ lock
323323
324- 		$ head stream_get_contents ($ handleself ::META_HEADER_LEN );
325- 		if  ($ head strlen ($ head self ::META_HEADER_LEN ) {
326- 			$ sizeint ) substr ( $ head , - 6 ) ;
324+ 		$ size stream_get_contents ($ handleself ::META_HEADER_LEN );
325+ 		if  ($ size strlen ($ size self ::META_HEADER_LEN ) {
326+ 			$ sizeint ) $ size 
327327			$ metastream_get_contents ($ handle$ sizeself ::META_HEADER_LEN );
328328			$ metaunserialize ($ meta
329329			$ metaself ::FILE ] = $ file
0 commit comments