File tree 1 file changed +5
-2
lines changed
src/Symfony/Bundle/FrameworkBundle/CacheWarmer
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ public function warmUp($cacheDir)
62
62
}
63
63
64
64
$ adapter = new PhpArrayAdapter ($ this ->phpArrayFile , $ this ->fallbackPool );
65
- $ arrayPool = new ArrayAdapter (0 , false );
65
+ $ arrayPool = new ArrayAdapter (0 );
66
66
67
67
$ loaders = $ this ->validatorBuilder ->getLoaders ();
68
68
$ metadataFactory = new LazyLoadingMetadataFactory (new LoaderChain ($ loaders ), new Psr6Cache ($ arrayPool ));
@@ -86,7 +86,10 @@ public function warmUp($cacheDir)
86
86
spl_autoload_unregister (array ($ adapter , 'throwOnRequiredClass ' ));
87
87
}
88
88
89
- $ values = $ arrayPool ->getValues ();
89
+ // the ArrayAdapter stores the values serialized as the MetaData objects
90
+ // are mutated inside LazyLoadingMetadataFactory after being written into the cache
91
+ // so here we un-serialize the values first
92
+ $ values = array_map (function ($ val ) { return unserialize ($ val ); }, $ arrayPool ->getValues ());
90
93
$ adapter ->warmUp (array_filter ($ values ));
91
94
92
95
foreach ($ values as $ k => $ v ) {
You can’t perform that action at this time.
0 commit comments