Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
performance-booster
/
vendor
/
symfony
/
serializer
/
CacheWarmer
/
File Content:
CompiledClassMetadataCacheWarmer.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PerformanceBooster\Symfony\Component\Serializer\CacheWarmer; use PerformanceBooster\Symfony\Component\Filesystem\Filesystem; use PerformanceBooster\Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; use PerformanceBooster\Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryCompiler; use PerformanceBooster\Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface; /** * @author Fabien Bourigault <bourigaultfabien@gmail.com> */ final class CompiledClassMetadataCacheWarmer implements CacheWarmerInterface { public function __construct(private readonly array $classesToCompile, private readonly ClassMetadataFactoryInterface $classMetadataFactory, private readonly ClassMetadataFactoryCompiler $classMetadataFactoryCompiler, private readonly Filesystem $filesystem) { } public function warmUp(string $cacheDir, ?string $buildDir = null) : array { $metadatas = []; foreach ($this->classesToCompile as $classToCompile) { $metadatas[] = $this->classMetadataFactory->getMetadataFor($classToCompile); } $code = $this->classMetadataFactoryCompiler->compile($metadatas); $this->filesystem->dumpFile("{$cacheDir}/serializer.class.metadata.php", $code); return []; } public function isOptional() : bool { return \true; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
CompiledClassMetadataCacheWarmer.php
1611 bytes
0644
N4ST4R_ID | Naxtarrr