Project

General

Profile

Bug #24389 » 16812_02.diff

Administrator Admin, 2011-01-13 22:25

View differences:

t3lib/config_default.php (working copy)
'cacheTable' => 'cachingframework_cache_pagesection',
'tagsTable' => 'cachingframework_cache_pagesection_tags',
)
)
),
'cache_runtime' => array(
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_TransientMemoryBackend',
'options' => array(),
),
)
),
'useCachingFramework' => FALSE, // Boolean: Enable this if you want to use the caching framework by default for the core caches cache_pages, cache_pagesection and cache_hash.
t3lib/class.t3lib_cache.php (working copy)
}
/**
* Initializes the cache_runtime cache.
* This cache is designed to cache data which is only valid for one request.
*
* @return void
* @author Christian Kuhn <lolli@schwarzbu.ch>
*/
public static function initRuntimeCache() {
try {
$GLOBALS['typo3CacheFactory']->create(
'cache_runtime',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_runtime']['frontend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_runtime']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_runtime']['options']
);
} catch (t3lib_cache_exception_DuplicateIdentifier $e) {
// do nothing, a cache_hash cache already exists
}
}
/**
* Determines whether the caching framework is initialized.
* The caching framework could be disabled for the core but used by an extension.
*
......
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_cache.php']);
}
?>
?>
typo3/init.php (working copy)
t3lib_cache::initPageCache();
t3lib_cache::initPageSectionCache();
t3lib_cache::initContentHashCache();
t3lib_cache::initRuntimeCache();
}
// *************************
// CLI dispatch processing
......
ob_start('ob_gzhandler');
}
?>
?>
typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
t3lib_cache::initPageSectionCache();
t3lib_cache::initContentHashCache();
t3lib_cache::initRuntimeCache();
$GLOBALS['TT']->pull();
}
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
foreach ($targetPageRootline as $data) {
$targetPageRootlinePids[] = intval($data['uid']);
}
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid, domainName, forced',
'sys_domain',
'pid IN (' . implode(',', $targetPageRootlinePids) . ') ' . ' AND redirectTo=\'\' ' . $this->enableFields('sys_domain'),
'',
'sorting ASC'
);
// TODO maybe it makes sense to hold all sys_domain records in a cache to save additional DB querys on each typolink
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$foundDomains[] = preg_replace('/\/$/', '', $row['domainName']);
if (!isset($firstFoundDomains[$row['pid']])) {
$firstFoundDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
if (TYPO3_UseCachingFramework) {
$entryIdentifier = 'sys_domain_' . sha1(implode('', $targetPageRootlinePids));
$runtimeCache = $GLOBALS['typo3CacheManager']->getCache('cache_runtime');
if ($runtimeCache->has($entryIdentifier)) {
$entry = $runtimeCache->get($entryIdentifier);
$foundDomains = $entry['foundDomains'];
$firstFoundDomains = $entry['firstFoundDomains'];
$firstFoundForcedDomains = $entry['firstFoundForcedDomains'];
$targetPageRootlinePids = $entry['targetPageRootlinePids'];
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid, domainName, forced',
'sys_domain',
'pid IN (' . implode(',', $targetPageRootlinePids) . ') ' . ' AND redirectTo=\'\' ' . $this->enableFields('sys_domain'),
'',
'sorting ASC'
);
// TODO maybe it makes sense to hold all sys_domain records in a cache to save additional DB querys on each typolink
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$foundDomains[] = preg_replace('/\/$/', '', $row['domainName']);
if (!isset($firstFoundDomains[$row['pid']])) {
$firstFoundDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
}
if ($row['forced'] && !isset($firstFoundForcedDomains[$row['pid']])) {
$firstFoundForcedDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$runtimeCache->set(
$entryIdentifier,
array(
'foundDomains' => $foundDomains,
'firstFoundDomains' => $firstFoundDomains,
'firstFoundForcedDomains' => $firstFoundForcedDomains,
'targetPageRootlinePids' => $targetPageRootlinePids,
)
);
}
if ($row['forced'] && !isset($firstFoundForcedDomains[$row['pid']])) {
$firstFoundForcedDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
} else {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid, domainName, forced',
'sys_domain',
'pid IN (' . implode(',', $targetPageRootlinePids) . ') ' . ' AND redirectTo=\'\' ' . $this->enableFields('sys_domain'),
'',
'sorting ASC'
);
// TODO maybe it makes sense to hold all sys_domain records in a cache to save additional DB querys on each typolink
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$foundDomains[] = preg_replace('/\/$/', '', $row['domainName']);
if (!isset($firstFoundDomains[$row['pid']])) {
$firstFoundDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
}
if ($row['forced'] && !isset($firstFoundForcedDomains[$row['pid']])) {
$firstFoundForcedDomains[$row['pid']] = preg_replace('/\/$/', '', $row['domainName']);
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// Set targetDomain to first found domain record if the target page cannot be reached within the current domain
if (count($foundDomains) > 0 && (!in_array($currentDomain, $foundDomains) || count($firstFoundForcedDomains) > 0)) {
......
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['tslib/class.tslib_content.php']);
}
?>
?>
(2-2/5)