Bug #24653 ยป 17130_01.diff
tests/t3lib/cache/backend/t3lib_cache_backend_dbbackendTest.php (working copy) | ||
---|---|---|
/**
|
||
* @test
|
||
* @expectedException t3lib_cache_Exception
|
||
* @author Ingo Renner <ingo@typo3.org>
|
||
*/
|
||
# deactivated as the according check in the DB backend causes trouble during TYPO3's initialization
|
||
# public function setCacheTableThrowsExceptionOnNonExistentTable() {
|
||
# $this->backend->setCacheTable('test_cache_non_existent_table');
|
||
# }
|
||
/**
|
||
* @test
|
||
* @author Ingo Renner <ingo@typo3.org>
|
||
*/
|
||
public function getCacheTableReturnsThePreviouslySetTable() {
|
||
$this->setUpBackend();
|
||
$this->backend->setCacheTable($this->testingCacheTable);
|
t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php (working copy) | ||
---|---|---|
* @author Ingo Renner <ingo@typo3.org>
|
||
*/
|
||
public function setCacheTable($cacheTable) {
|
||
/*
|
||
TODO reenable this check or remove it before 4.3 final
|
||
This check causes mysql warnings when not being logged in and calling
|
||
typo3/backend.php or the install tool.
|
||
Reason: the caches in typo3/init.php get initialized before a DB connection
|
||
has been established.
|
||
Related Question: Why aren't there warnings in the FE as the caches get
|
||
initialized in tslib_fe's constructor which is also before a DB conection
|
||
exsits?
|
||
Assumption Ingo Renner: Is a custom error_reporting level causing that?
|
||
There's also an unit test for that check (also deactivated for now).
|
||
$result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
|
||
'id',
|
||
$cacheTable,
|
||
'',
|
||
'',
|
||
'',
|
||
1
|
||
);
|
||
if (!is_array($result)) {
|
||
throw new t3lib_cache_Exception(
|
||
'The table "' . $cacheTable . '" does not exist.',
|
||
1236516444
|
||
);
|
||
}
|
||
*/
|
||
$this->cacheTable = $cacheTable;
|
||
$this->initializeCommonReferences();
|
||
}
|