public static function initialize()
{
$strCacheDir = \System::getContainer()->getParameter('kernel.cache_dir');
// Try to load from cache
if (file_exists($strCacheDir . '/contao/config/templates.php')) {
self::addFiles(include $strCacheDir . '/contao/config/templates.php');
} else {
try {
foreach (\System::getContainer()->get('contao.resource_finder')->findIn('templates')->name('*.html5') as $file) {
self::addFile($file->getBasename('.html5'), $file->getPath());
}
} catch (\InvalidArgumentException $e) {
}
}
}