Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
[BUGFIX] Adapt cache configuration to 4.6
Browse files Browse the repository at this point in the history
Change-Id: Ifcc5f66cd61c32bf2bf219da21eea67939d3b77c
Resolves: #27546
Depends: #27506
Depends: #27536
  • Loading branch information
lolli42 committed Jun 26, 2011
1 parent 5615fb9 commit f009f64
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 117 deletions.
13 changes: 1 addition & 12 deletions Classes/Core/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,18 +172,7 @@ public function configureObjectManager() {
* @see initialize()
*/
protected function initializeCache() {
t3lib_cache::initializeCachingFramework();
$this->cacheManager = $GLOBALS['typo3CacheManager'];
try {
$this->cacheManager->getCache('cache_extbase_reflection');
} catch (t3lib_cache_exception_NoSuchCache $exception) {
$GLOBALS['typo3CacheFactory']->create(
'cache_extbase_reflection',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['frontend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['options']
);
}
}

/**
Expand All @@ -194,7 +183,7 @@ protected function initializeCache() {
*/
protected function initializeReflection() {
$this->reflectionService = $this->objectManager->get('Tx_Extbase_Reflection_Service');
$this->reflectionService->setDataCache($this->cacheManager->getCache('cache_extbase_reflection'));
$this->reflectionService->setDataCache($this->cacheManager->getCache('extbase_reflection'));
if (!$this->reflectionService->isInitialized()) {
$this->reflectionService->initialize();
}
Expand Down
12 changes: 1 addition & 11 deletions Classes/Object/Container/ClassInfoCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,6 @@ public function set($id,$value) {
* Initialize the TYPO3 second level cache
*/
private function initializeLevel2Cache() {
t3lib_cache::initializeCachingFramework();
try {
$this->level2Cache = $GLOBALS['typo3CacheManager']->getCache('cache_extbase_object');
} catch (t3lib_cache_exception_NoSuchCache $exception) {
$this->level2Cache = $GLOBALS['typo3CacheFactory']->create(
'cache_extbase_object',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['frontend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['options']
);
}
$this->level2Cache = $GLOBALS['typo3CacheManager']->getCache('extbase_object');
}
}
29 changes: 10 additions & 19 deletions ext_localconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,16 @@
require_once(t3lib_extMgm::extPath('extbase') . 'Classes/Dispatcher.php');
require_once(t3lib_extMgm::extPath('extbase') . 'Classes/Utility/Extension.php');

// use own cache tables
// Reflection cache:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection'] = array(
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_DbBackend',
'options' => array(
'cacheTable' => 'tx_extbase_cache_reflection',
'tagsTable' => 'tx_extbase_cache_reflection_tags',
),
);
// Object container cache:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object'] = array(
'frontend' => 't3lib_cache_frontend_VariableFrontend',
'backend' => 't3lib_cache_backend_DbBackend',
'options' => array(
'cacheTable' => 'tx_extbase_cache_object',
'tagsTable' => 'tx_extbase_cache_object_tags',
),
);
// Register caches if not already done in localconf.php or a previously loaded extension.
// We do not set frontend and backend: The cache manager uses t3lib_cache_frontend_VariableFrontend
// and t3lib_cache_backend_DbBackend by default if not set otherwise.
// This default is perfectly fine for our reflection and object cache.
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection'] = array();
}
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object'] = array();
}

// We need to set the default implementation for Storage Backend & Query Settings
// the code below is NO PUBLIC API! It's just to make sure that
Expand Down
23 changes: 0 additions & 23 deletions ext_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,7 @@
if (!defined ('TYPO3_MODE')) die ('Access denied.');

if (TYPO3_MODE == 'BE') {

// register the cache in BE so it will be cleared with "clear all caches"
try {
t3lib_cache::initializeCachingFramework();
// Reflection cache
$GLOBALS['typo3CacheFactory']->create(
'tx_extbase_cache_reflection',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['frontend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_reflection']['options']
);
// Object container cache
$GLOBALS['typo3CacheFactory']->create(
'tx_extbase_cache_object',
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['frontend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['backend'],
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['cache_extbase_object']['options']
);
} catch(t3lib_cache_exception_NoSuchCache $exception) {

}

$TBE_MODULES['_dispatcher'][] = 'Tx_Extbase_Core_Bootstrap';

}

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['extbase'][] = 'tx_extbase_utility_extbaserequirementscheck';
Expand Down
52 changes: 0 additions & 52 deletions ext_tables.sql
Original file line number Diff line number Diff line change
@@ -1,55 +1,3 @@
#
# Table structure for table 'tx_extbase_cache_reflection'
#
CREATE TABLE tx_extbase_cache_reflection (
id int(11) unsigned NOT NULL auto_increment,
identifier varchar(250) DEFAULT '' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
content mediumtext,
tags mediumtext,
lifetime int(11) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY cache_id (identifier)
) ENGINE=InnoDB;

#
# Table structure for table 'tx_extbase_cache_reflection_tags'
#
CREATE TABLE tx_extbase_cache_reflection_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;

#
# Table structure for table 'tx_extbase_cache_object'
#
CREATE TABLE tx_extbase_cache_object (
id int(11) unsigned NOT NULL auto_increment,
identifier varchar(250) DEFAULT '' NOT NULL,
crdate int(11) unsigned DEFAULT '0' NOT NULL,
content mediumtext,
tags mediumtext,
lifetime int(11) unsigned DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY cache_id (identifier)
) ENGINE=InnoDB;

#
# Table structure for table 'tx_extbase_cache_object_tags'
#
CREATE TABLE tx_extbase_cache_object_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;

#
# Add field 'tx_extbase_type' to table 'fe_users'
#
Expand Down

0 comments on commit f009f64

Please sign in to comment.