public function load($blnNoCache = false)
{
// Return if the data has been loaded already
if (isset($GLOBALS['loadDataContainer'][$this->strTable]) && !$blnNoCache) {
return;
}
$GLOBALS['loadDataContainer'][$this->strTable] = true;
// see #6145
$strCacheDir = \System::getContainer()->getParameter('kernel.cache_dir');
// Try to load from cache
if (file_exists($strCacheDir . '/contao/dca/' . $this->strTable . '.php')) {
include $strCacheDir . '/contao/dca/' . $this->strTable . '.php';
} else {
try {
$files = \System::getContainer()->get('contao.resource_locator')->locate('dca/' . $this->strTable . '.php', null, false);
} catch (\InvalidArgumentException $e) {
$files = array();
}
foreach ($files as $file) {
include $file;
}
}
// HOOK: allow to load custom settings
if (isset($GLOBALS['TL_HOOKS']['loadDataContainer']) && is_array($GLOBALS['TL_HOOKS']['loadDataContainer'])) {
foreach ($GLOBALS['TL_HOOKS']['loadDataContainer'] as $callback) {
$this->import($callback[0]);
$this->{$callback[0]}->{$callback[1]}($this->strTable);
}
}
// Local configuration file
if (file_exists(TL_ROOT . '/system/config/dcaconfig.php')) {
@trigger_error('Using the dcaconfig.php file has been deprecated and will no longer work in Contao 5.0. Create one or more DCA files in app/Resources/contao/dca instead.', E_USER_DEPRECATED);
include TL_ROOT . '/system/config/dcaconfig.php';
}
}