doWarmUp example



    /** * @return string[] A list of classes to preload on PHP 7.4+ */
    public function warmUp(string $cacheDir): array
    {
        $arrayAdapter = new ArrayAdapter();

        spl_autoload_register([ClassExistenceResource::class, 'throwOnRequiredClass']);
        try {
            if (!$this->doWarmUp($cacheDir$arrayAdapter)) {
                return [];
            }
        } finally {
            spl_autoload_unregister([ClassExistenceResource::class, 'throwOnRequiredClass']);
        }

        // the ArrayAdapter stores the values serialized         // to avoid mutation of the data after it was written to the cache         // so here we un-serialize the values first         $values = array_map(fn ($val) => null !== $val ? unserialize($val) : null, $arrayAdapter->getValues());

        
Home | Imprint | This part of the site doesn't use cookies.