Project

General

Profile

Bug #25106 » 17673-workspaces.diff

Administrator Admin, 2011-02-19 17:48

View differences:

typo3/sysext/workspaces/ext_localconf.php (working copy)
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['viewOnClickClass']['workspaces'] = 'EXT:workspaces/Classes/Service/Tcemain.php:tx_Workspaces_Service_Befunc';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['hook_eofe']['workspaces'] = 'EXT:workspaces/Classes/Service/Fehooks.php:tx_Workspaces_Service_Fehooks->hook_eofe';
if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['useCachingFramework']) {
// Initialize the caching framework. The caching framework is asking it self if it is initialized already before initializing.
t3lib_cache::initializeCachingFramework();
// Initialize the caching framework. The caching framework is asking it self if it is initialized already before initializing.
t3lib_cache::initializeCachingFramework();
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'] = 't3lib_cache_backend_DbBackend';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options'] = array(
'cacheTable' => 'sys_workspace_cache',
'tagsTable' => 'sys_workspace_cache_tags'
);
}
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'] = 't3lib_cache_backend_DbBackend';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options'] = array(
'cacheTable' => 'sys_workspace_cache',
'tagsTable' => 'sys_workspace_cache_tags'
);
t3lib_extMgm::addUserTSConfig('options.workspaces.considerReferences = 1');
?>
?>
typo3/sysext/workspaces/Classes/Service/GridData.php (working copy)
* @return void
*/
protected function initializeWorkspacesCachingFramework() {
if (TYPO3_UseCachingFramework === TRUE) {
try {
$GLOBALS['typo3CacheFactory']->create(
'workspaces_cache',
't3lib_cache_frontend_StringFrontend',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options']);
} catch (t3lib_cache_exception_DuplicateIdentifier $e) {
// do nothing, a workspace cache already exists
}
$this->workspacesCache = $GLOBALS['typo3CacheManager']->getCache('workspaces_cache');
try {
$GLOBALS['typo3CacheFactory']->create(
'workspaces_cache',
't3lib_cache_frontend_StringFrontend',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options']);
} catch (t3lib_cache_exception_DuplicateIdentifier $e) {
// do nothing, a workspace cache already exists
}
$this->workspacesCache = $GLOBALS['typo3CacheManager']->getCache('workspaces_cache');
}
......
* @param string $filterTxt The given filter text from the grid.
*/
protected function setDataArrayIntoCache (array $versions, $filterTxt) {
if (TYPO3_UseCachingFramework === TRUE) {
$hash = $this->calculateHash($versions, $filterTxt);
$content = serialize($this->dataArray);
$hash = $this->calculateHash($versions, $filterTxt);
$content = serialize($this->dataArray);
$this->workspacesCache->set($hash, $content, array($this->currentWorkspace));
}
$this->workspacesCache->set($hash, $content, array($this->currentWorkspace));
}
......
protected function getDataArrayFromCache (array $versions, $filterTxt) {
$cacheEntry = FALSE;
if (TYPO3_UseCachingFramework === TRUE) {
$hash = $this->calculateHash($versions, $filterTxt);
$hash = $this->calculateHash($versions, $filterTxt);
$content = $this->workspacesCache->get($hash);
$content = $this->workspacesCache->get($hash);
if ($content != FALSE) {
$this->dataArray = unserialize($content);
$cacheEntry = TRUE;
}
if ($content != FALSE) {
$this->dataArray = unserialize($content);
$cacheEntry = TRUE;
}
return $cacheEntry;
typo3/sysext/workspaces/Classes/Service/Tcemain.php (working copy)
* @return void
*/
public function processCmdmap_afterFinish(t3lib_TCEmain $tcemainObj) {
if (TYPO3_UseCachingFramework) {
$this->flushWorkspaceCacheEntriesByWorkspaceId($tcemainObj->BE_USER->workspace);
}
$this->flushWorkspaceCacheEntriesByWorkspaceId($tcemainObj->BE_USER->workspace);
}
/**
......
* @return void
*/
protected function flushWorkspaceCacheEntriesByWorkspaceId($workspaceId) {
if (TYPO3_UseCachingFramework === TRUE) {
try {
$GLOBALS['typo3CacheFactory']->create(
'workspaces_cache',
't3lib_cache_frontend_StringFrontend',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options']);
} catch (t3lib_cache_exception_DuplicateIdentifier $e) {
// do nothing, a workspace cache already exists
}
$workspacesCache = $GLOBALS['typo3CacheManager']->getCache('workspaces_cache');
$workspacesCache->flushByTag($workspaceId);
$workspacesCache->flushByTag(tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
try {
$GLOBALS['typo3CacheFactory']->create(
'workspaces_cache',
't3lib_cache_frontend_StringFrontend',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['options']);
} catch (t3lib_cache_exception_DuplicateIdentifier $e) {
// do nothing, a workspace cache already exists
}
$workspacesCache = $GLOBALS['typo3CacheManager']->getCache('workspaces_cache');
$workspacesCache->flushByTag($workspaceId);
$workspacesCache->flushByTag(tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
}
}
(4-4/4)