*/
protected function initializeWorkspacesCachingFramework() {
if (TYPO3_UseCachingFramework === TRUE) {
- try {
- $GLOBALS['typo3CacheFactory']->create(
- 'workspaces_cache',
- $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['frontend'],
- $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');
}
}
protected function setDataArrayIntoCache (array $versions, $filterTxt) {
if (TYPO3_UseCachingFramework === TRUE) {
$hash = $this->calculateHash($versions, $filterTxt);
- $content = serialize($this->dataArray);
-
- $this->workspacesCache->set($hash, $content, array($this->currentWorkspace));
+ $this->workspacesCache->set($hash, $this->dataArray, array($this->currentWorkspace));
}
}
*
* @param array $versions All records uids etc. First key is table name, second key incremental integer. Records are associative arrays with uid, t3ver_oid and t3ver_swapmode fields. The pid of the online record is found as "livepid" the pid of the offline record is found in "wspid"
* @param string $filterTxt The given filter text from the grid.
+ * @return boolean TRUE if cache entry was successfully fetched from cache and content put to $this->dataArray
*/
protected function getDataArrayFromCache (array $versions, $filterTxt) {
$cacheEntry = FALSE;
$content = $this->workspacesCache->get($hash);
- if ($content != FALSE) {
- $this->dataArray = unserialize($content);
+ if ($content !== FALSE) {
+ $this->dataArray = $content;
$cacheEntry = TRUE;
}
}
*/
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);
}
$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();
-
- $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['sys_workspace_cache']['frontend'] = 't3lib_cache_frontend_VariableFrontend';
- $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']['workspaces_cache']['frontend'] = 't3lib_cache_frontend_VariableFrontend';
+ $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache']['backend'] = 't3lib_cache_backend_DbBackend';
+ $GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['workspaces_cache']['options'] = array();
}
t3lib_extMgm::addUserTSConfig('options.workspaces.considerReferences = 1');
PRIMARY KEY (uid),
KEY parent (pid)
-);
-
-
-#
-# Table structure for table 'sys_workspace_cache'
-#
-CREATE TABLE sys_workspace_cache (
- id int(11) unsigned NOT NULL auto_increment,
- identifier varchar(32) DEFAULT '' NOT NULL,
- content mediumblob NOT NULL,
- crdate int(11) DEFAULT '0' NOT NULL,
- lifetime int(11) DEFAULT '0' NOT NULL,
- PRIMARY KEY (id),
- KEY cache_id (identifier)
-) ENGINE=InnoDB;
-
-
-#
-# Table structure for table 'sys_workspace_cache_tags'
-#
-CREATE TABLE sys_workspace_cache_tags (
- id int(11) unsigned NOT NULL auto_increment,
- identifier varchar(128) DEFAULT '' NOT NULL,
- tag varchar(128) DEFAULT '' NOT NULL,
- PRIMARY KEY (id),
- KEY cache_id (identifier),
- KEY cache_tag (tag)
-) ENGINE=InnoDB;
+);
\ No newline at end of file