Commit 61db10aa authored by Steffen Kamper's avatar Steffen Kamper
Browse files

Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_cache_directory

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9597 709f56b5-9817-0410-a4d7-c38de5d9e867
parent dc7055ad
2010-11-24 Steffen Kamper <steffen@typo3.org>
 
* Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_cache_directory
* Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_xml
* Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_userauthgroup
* Fixed bug #14050: CleanUp - CGL format of t3lib files - t3lib_userauth
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* An abstract caching backend
......@@ -132,7 +132,7 @@ abstract class t3lib_cache_backend_AbstractBackend implements t3lib_cache_backen
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_abstractbackend.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_abstractbackend.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_abstractbackend.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
......@@ -207,7 +207,7 @@ class t3lib_cache_backend_ApcBackend extends t3lib_cache_backend_AbstractBackend
*/
public function findIdentifiersByTags(array $tags) {
$taggedEntries = array();
$foundEntries = array();
$foundEntries = array();
foreach ($tags as $tag) {
$taggedEntries[$tag] = $this->findIdentifiersByTag($tag);
......@@ -236,7 +236,7 @@ class t3lib_cache_backend_ApcBackend extends t3lib_cache_backend_AbstractBackend
$success = FALSE;
$tags = apc_fetch($this->identifierPrefix . 'ident_' . $identifier, $success);
return ($success ? (array)$tags : array());
return ($success ? (array) $tags : array());
}
/**
......@@ -354,7 +354,7 @@ class t3lib_cache_backend_ApcBackend extends t3lib_cache_backend_AbstractBackend
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_apcbackend.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_apcbackend.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_apcbackend.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2008-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2008-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
......@@ -90,7 +90,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
$this->tableList = $this->cacheTable . ', ' . $this->tagsTable;
$this->tableJoin = $this->identifierField . ' = ' . $this->tagsTable . '.identifier';
$this->notExpiredStatement = '(' . $this->creationField . ' + ' . $this->lifetimeField .
' >= ' . $GLOBALS['EXEC_TIME'] . ' OR ' . $this->lifetimeField . ' = 0)';
' >= ' . $GLOBALS['EXEC_TIME'] . ' OR ' . $this->lifetimeField . ' = 0)';
}
/**
......@@ -133,10 +133,10 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
$GLOBALS['TYPO3_DB']->exec_INSERTquery(
$this->cacheTable,
array(
'identifier' => $entryIdentifier,
'crdate' => $GLOBALS['EXEC_TIME'],
'content' => $data,
'lifetime' => $lifetime
'identifier' => $entryIdentifier,
'crdate' => $GLOBALS['EXEC_TIME'],
'content' => $data,
'lifetime' => $lifetime
)
);
......@@ -175,7 +175,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
'content',
$this->cacheTable,
'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) . ' '
. 'AND (crdate + lifetime >= ' . $GLOBALS['EXEC_TIME'] . ' OR lifetime = 0)'
. 'AND (crdate + lifetime >= ' . $GLOBALS['EXEC_TIME'] . ' OR lifetime = 0)'
);
if (count($cacheEntries) == 1) {
......@@ -203,7 +203,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
'*',
$this->cacheTable,
'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->cacheTable) .
' AND (crdate + lifetime >= ' . $GLOBALS['EXEC_TIME'] . ' OR lifetime = 0)'
' AND (crdate + lifetime >= ' . $GLOBALS['EXEC_TIME'] . ' OR lifetime = 0)'
);
if ($cacheEntries >= 1) {
$hasEntry = TRUE;
......@@ -233,7 +233,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
'identifier = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($entryIdentifier, $this->tagsTable)
);
if($GLOBALS['TYPO3_DB']->sql_affected_rows($res) == 1) {
if ($GLOBALS['TYPO3_DB']->sql_affected_rows($res) == 1) {
$entryRemoved = true;
}
......@@ -254,8 +254,8 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
$this->identifierField,
$this->tableList,
$this->getQueryForTag($tag) .
' AND ' . $this->tableJoin .
' AND ' . $this->notExpiredStatement,
' AND ' . $this->tableJoin .
' AND ' . $this->notExpiredStatement,
$this->identifierField
);
......@@ -276,7 +276,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
*/
public function findIdentifiersByTags(array $tags) {
$cacheEntryIdentifiers = array();
$whereClause = array();
$whereClause = array();
foreach ($tags as $tag) {
$whereClause[] = $this->getQueryForTag($tag);
......@@ -399,37 +399,37 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
* @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
);
}
*/
/*
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();
}
......@@ -540,7 +540,7 @@ class t3lib_cache_backend_DbBackend extends t3lib_cache_backend_AbstractBackend
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_dbbackend.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
......@@ -86,7 +86,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
$cacheDirectory = 'typo3temp/cache/';
try {
$this->setCacheDirectory($cacheDirectory);
} catch(t3lib_cache_Exception $exception) {
} catch (t3lib_cache_Exception $exception) {
}
}
}
......@@ -109,7 +109,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
if (TYPO3_OS === 'WIN') {
$delimiter = ';';
$cacheDirectory = str_replace('\\', '/', $cacheDirectory);
if (!(preg_match('/[A-Z]:/', substr($cacheDirectory,0,2)))) {
if (!(preg_match('/[A-Z]:/', substr($cacheDirectory, 0, 2)))) {
$cacheDirectory = PATH_site . $cacheDirectory;
}
} else {
......@@ -180,7 +180,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
}
$this->root = $documentRoot;
$this->cacheDirectory = $cacheDirectory;
$this->cacheDirectory = $cacheDirectory;
}
/**
......@@ -235,8 +235,8 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
if (strlen($temporaryCacheEntryPathAndFilename) > $this->maximumPathLength) {
throw new t3lib_cache_Exception(
'The length of the temporary cache file path "' . $temporaryCacheEntryPathAndFilename .
'" is ' . strlen($temporaryCacheEntryPathAndFilename) . ' characters long and exceeds the maximum path length of ' .
$this->maximumPathLength . '. Please consider setting the temporaryDirectoryBase option to a shorter path. ',
'" is ' . strlen($temporaryCacheEntryPathAndFilename) . ' characters long and exceeds the maximum path length of ' .
$this->maximumPathLength . '. Please consider setting the temporaryDirectoryBase option to a shorter path. ',
1248710426
);
}
......@@ -289,7 +289,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
if ($this->isCacheFileExpired($pathAndFilename)) {
return FALSE;
}
$dataSize = (integer)file_get_contents($pathAndFilename, NULL, NULL, filesize($pathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$dataSize = (integer) file_get_contents($pathAndFilename, NULL, NULL, filesize($pathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
return file_get_contents($pathAndFilename, NULL, NULL, 0, $dataSize);
}
......@@ -357,10 +357,10 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
continue;
}
$cacheEntryPathAndFilename = $directoryIterator->getPathname();
$index = (integer)file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$index = (integer) file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$metaData = file_get_contents($cacheEntryPathAndFilename, NULL, NULL, $index);
$expiryTime = (integer)substr($metaData, 0, self::EXPIRYTIME_LENGTH);
$expiryTime = (integer) substr($metaData, 0, self::EXPIRYTIME_LENGTH);
if ($expiryTime !== 0 && $expiryTime < $now) {
continue;
}
......@@ -388,10 +388,10 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
continue;
}
$cacheEntryPathAndFilename = $directoryIterator->getPathname();
$index = (integer)file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$index = (integer) file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$metaData = file_get_contents($cacheEntryPathAndFilename, NULL, NULL, $index);
$expiryTime = (integer)substr($metaData, 0, self::EXPIRYTIME_LENGTH);
$expiryTime = (integer) substr($metaData, 0, self::EXPIRYTIME_LENGTH);
if ($expiryTime !== 0 && $expiryTime < $GLOBALS['EXEC_TIME']) {
continue;
}
......@@ -459,7 +459,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
if (!file_exists($cacheEntryPathAndFilename)) {
return TRUE;
}
$index = (integer)file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$index = (integer) file_get_contents($cacheEntryPathAndFilename, NULL, NULL, filesize($cacheEntryPathAndFilename) - self::DATASIZE_DIGITS, self::DATASIZE_DIGITS);
$expiryTime = file_get_contents($cacheEntryPathAndFilename, NULL, NULL, $index, self::EXPIRYTIME_LENGTH);
return ($expiryTime != 0 && $expiryTime < $GLOBALS['EXEC_TIME']);
}
......@@ -486,8 +486,8 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
foreach ($filesFound as $cacheFilename) {
if ($this->isCacheFileExpired($cacheFilename)) {
$this->remove(basename($cacheFilename));
}
}
}
}
}
}
......@@ -540,7 +540,7 @@ class t3lib_cache_backend_FileBackend extends t3lib_cache_backend_AbstractBacken
}
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php']) {
if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/cache/backend/class.t3lib_cache_backend_filebackend.php']);
}
......
<?php
/***************************************************************
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 2009-2010 Ingo Renner <ingo@typo3.org>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
......@@ -243,7 +243,7 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
}
try {
if(strlen($data) > self::MAX_BUCKET_SIZE) {
if (strlen($data) > self::MAX_BUCKET_SIZE) {
$data = str_split($data, 1024 * 1000);
$success = TRUE;
$chunkNumber = 1;
......@@ -281,7 +281,7 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
1275830266
);
}
} catch(Exception $exception) {
} catch (Exception $exception) {
throw new t3lib_cache_Exception(
'Could not set value. ' .
$exception->getMessage(),
......@@ -302,10 +302,10 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
$value = $this->memcache->get($this->identifierPrefix . $entryIdentifier);
if (substr($value, 0, 14) === 'TYPO3*chunked:') {
list( , $chunkCount) = explode(':', $value);
list(, $chunkCount) = explode(':', $value);
$value = '';
for ($chunkNumber = 1 ; $chunkNumber < $chunkCount; $chunkNumber++) {
for ($chunkNumber = 1; $chunkNumber < $chunkCount; $chunkNumber++) {
$value .= $this->memcache->get($this->identifierPrefix . $entryIdentifier . '_chunk_' . $chunkNumber);
}
}
......@@ -369,7 +369,7 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
*/
public function findIdentifiersByTags(array $tags) {
$taggedEntries = array();
$foundEntries = array();
$foundEntries = array();
foreach ($tags as $tag) {
$taggedEntries[$tag] = $this->findIdentifiersByTag($tag);
......@@ -408,7 +408,7 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
public function flushByTag($tag) {
$identifiers = $this->findIdentifiersByTag($tag);
foreach($identifiers as $identifier) {
foreach ($identifiers as $identifier) {
$this->remove($identifier);
}
}
......@@ -438,20 +438,20 @@ class t3lib_cache_backend_MemcachedBackend extends t3lib_cache_backend_AbstractB
*/
protected function addIdentifierToTags($entryIdentifier, array $tags) {
if ($this->serverConnected) {
foreach($tags as $tag) {
foreach ($tags as $tag) {
// Update tag-to-identifier index
$identifiers = $this->findIdentifiersByTag($tag);
if (array_search($entryIdentifier, $identifiers) === false) {
$identifiers[] = $entryIdentifier;
$this->memcache->set($this->identifierPrefix . 'tag_' . $tag,
$identifiers);
$identifiers);
}
// Update identifier-to-tag index
$existingTags = $this->findTagsByIdentifier($entryIdentifier);
if (array_search($tag, $existingTags) === FALSE) {
$this->memcache->set($this->identifierPrefix . 'ident_' . $entryIdentifier,
array_merge($existingTags, $tags));
array_merge($existingTags, $tags));
}