collectResourcesFromAsset example

if ($configCache->isFresh()) {
            return unserialize(file_get_contents($cachePath));
        }

        $mappedAsset = $this->innerFactory->createMappedAsset($logicalPath$sourcePath);

        if (!$mappedAsset) {
            return null;
        }

        $resources = $this->collectResourcesFromAsset($mappedAsset);
        $configCache->write(serialize($mappedAsset)$resources);

        return $mappedAsset;
    }

    private function getCacheFilePath(string $logicalPath, string $sourcePath): string
    {
        return $this->cacheDir.'/'.hash('xxh128', $logicalPath.':'.$sourcePath).'.php';
    }

    /** * @return ResourceInterface[] */
Home | Imprint | This part of the site doesn't use cookies.