Commit 0462cfdd authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added a PAGE Tsconfig option to disable the automatic clearing of page cache when records are edited.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@234 709f56b5-9817-0410-a4d7-c38de5d9e867
parent a1201b8d
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
* Added a PAGE Tsconfig option to disable the automatic clearing of page cache when records are edited.
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
* Updated "cms" extension with most recent labels from TYPO3.org
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
* Updated "lang" extension with most recent labels from TYPO3.org
2004-04-26 Kasper Skårhøj,,, <kasper@typo3.com>
* Added Latvian, Japanese and Vietnamese languages
......
......@@ -2354,60 +2354,62 @@ class t3lib_TCEmain {
list($tscPID) = t3lib_BEfunc::getTSCpid($table,$uid,'');
$TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
// If table is "pages":
if (t3lib_extMgm::isLoaded('cms')) {
if ($table=='pages') {
if (!$TSConfig['clearCache_disable']) {
// If table is "pages":
if (t3lib_extMgm::isLoaded('cms')) {
if ($table=='pages') {
// Builds list of pages on the SAME level as this page (siblings)
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'A.pid AS pid, B.uid AS uid',
'pages AS A, pages AS B',
'A.uid='.intval($uid).' AND B.pid=A.pid AND B.deleted=0'
);
// Builds list of pages on the SAME level as this page (siblings)
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'A.pid AS pid, B.uid AS uid',
'pages AS A, pages AS B',
'A.uid='.intval($uid).' AND B.pid=A.pid AND B.deleted=0'
);
$list_cache = array();
$pid_tmp = 0;
while ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['uid'];
$pid_tmp = $row_tmp['pid'];
$list_cache = array();
$pid_tmp = 0;
while ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['uid'];
$pid_tmp = $row_tmp['pid'];
// Add children as well:
if ($TSConfig['clearCache_pageSiblingChildren']) {
$res_tmp2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
'pages',
'pid='.intval($row_tmp['uid']).' AND deleted=0'
);
while ($row_tmp2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp2)) {
$list_cache[] = $row_tmp2['uid'];
}
}
}
// Add children as well:
if ($TSConfig['clearCache_pageSiblingChildren']) {
$res_tmp2 = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'uid',
// Finally, add the parent page as well:
$list_cache[] = $pid_tmp;
// Add grand-parent as well:
if ($TSConfig['clearCache_pageGrandParent']) {
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid',
'pages',
'pid='.intval($row_tmp['uid']).' AND deleted=0'
'uid='.intval($pid_tmp)
);
while ($row_tmp2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp2)) {
$list_cache[] = $row_tmp2['uid'];
if ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['pid'];
}
}
}
// Finally, add the parent page as well:
$list_cache[] = $pid_tmp;
// Add grand-parent as well:
if ($TSConfig['clearCache_pageGrandParent']) {
$res_tmp = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid',
'pages',
'uid='.intval($pid_tmp)
);
if ($row_tmp = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res_tmp)) {
$list_cache[] = $row_tmp['pid'];
// Delete cache for selected pages:
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages','page_id IN ('.implode(',',$GLOBALS['TYPO3_DB']->cleanIntArray($list_cache)).')');
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection', 'page_id IN ('.implode(',',$GLOBALS['TYPO3_DB']->cleanIntArray($list_cache)).')');
} else { // For other tables than "pages", delete cache for the records "parent page".
$uid_page = $this->getPID($table,$uid);
if ($uid_page>0) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages', 'page_id='.intval($uid_page));
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection', 'page_id='.intval($uid_page));
}
}
// Delete cache for selected pages:
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages','page_id IN ('.implode(',',$GLOBALS['TYPO3_DB']->cleanIntArray($list_cache)).')');
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection', 'page_id IN ('.implode(',',$GLOBALS['TYPO3_DB']->cleanIntArray($list_cache)).')');
} else { // For other tables than "pages", delete cache for the records "parent page".
$uid_page = $this->getPID($table,$uid);
if ($uid_page>0) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pages', 'page_id='.intval($uid_page));
$GLOBALS['TYPO3_DB']->exec_DELETEquery('cache_pagesection', 'page_id='.intval($uid_page));
}
}
}
......@@ -2423,7 +2425,7 @@ class t3lib_TCEmain {
// Call post processing function for clear-cache:
global $TYPO3_CONF_VARS;
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
$_params = array('table' => $table,'uid' => $uid,'uid_page' => $uid_page);
$_params = array('table' => $table,'uid' => $uid,'uid_page' => $uid_page,'TSConfig' => $TSConfig);
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
t3lib_div::callUserFunction($_funcRef,$_params,$this);
}
......
This diff is collapsed.
......@@ -2,9 +2,9 @@
########################################################################
# Extension Manager/Repository config file for ext: "lang"
#
#
# Auto generated 26-04-2004 14:27
#
#
# Manual updates:
# Only the data in the array - anything else is removed by next write
########################################################################
......@@ -18,8 +18,8 @@ $EM_CONF[$_EXTKEY] = Array (
'conflicts' => '',
'priority' => 'top',
'loadOrder' => '',
'TYPO3_version' => '0.0.1-0.0.1',
'PHP_version' => '0.0.1-0.0.1',
'TYPO3_version' => '3.6.0RC2',
'PHP_version' => '',
'module' => '',
'state' => 'stable',
'internal' => 1,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment