Commit 015f697c authored by Arvid Jakobsson's avatar Arvid Jakobsson Committed by Helmut Hummel
Browse files

[TASK] Remove superfluous parenthesis in sysext core

Change ("a" . "b") . "c" into "a" . "b" . "c" using the lex-pass tool.

Change-Id: I818d55a2f00b549fef8377f1c6766c293edd021c
Resolves: #40880
Related: #40095
Releases: 6.0
Reviewed-on: http://review.typo3.org/14565
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Mattias Nilsson
Tested-by: Mattias Nilsson
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
parent 415c0866
......@@ -235,7 +235,7 @@ class Autoloader {
if (array_key_exists($classNameLower, self::$classNameToFileMapping)) {
$classPath = self::$classNameToFileMapping[$classNameLower];
}
if (($classPath === NULL && substr($classNameLower, 0, 3) === 'ux_') && !array_key_exists($classNameLower, self::$classNameToFileMapping)) {
if ($classPath === NULL && substr($classNameLower, 0, 3) === 'ux_' && !array_key_exists($classNameLower, self::$classNameToFileMapping)) {
self::$cacheUpdateRequired = TRUE;
self::$classNameToFileMapping[$classNameLower] = NULL;
}
......@@ -283,7 +283,7 @@ class Autoloader {
$delimiter = '\\';
}
$classNameParts = explode($delimiter, $tempClassName, 4);
if ((isset($classNameParts[0]) && $classNameParts[0] === 'TYPO3') && (isset($classNameParts[1]) && $classNameParts[1] === 'CMS')) {
if (isset($classNameParts[0]) && $classNameParts[0] === 'TYPO3' && (isset($classNameParts[1]) && $classNameParts[1] === 'CMS')) {
$extensionKey = \TYPO3\CMS\Core\Utility\GeneralUtility::camelCaseToLowerCaseUnderscored($classNameParts[2]);
$classNameWithoutVendorAndProduct = $classNameParts[3];
} else {
......@@ -333,8 +333,8 @@ class Autoloader {
static protected function updateRegistryCacheEntry(array $registry) {
$cachedFileContent = 'return array(';
foreach ($registry as $className => $classLocation) {
$nullOrLocation = is_string($classLocation) ? ('\'' . $classLocation) . '\',' : 'NULL,';
$cachedFileContent .= (((LF . '\'') . $className) . '\' => ') . $nullOrLocation;
$nullOrLocation = is_string($classLocation) ? '\'' . $classLocation . '\',' : 'NULL,';
$cachedFileContent .= LF . '\'' . $className . '\' => ' . $nullOrLocation;
}
$cachedFileContent .= LF . ');';
$GLOBALS['typo3CacheManager']->getCache('cache_core')->set(self::getAutoloadCacheIdentifier(), $cachedFileContent);
......@@ -353,7 +353,7 @@ class Autoloader {
*/
static protected function getAutoloadCacheIdentifier() {
if (is_null(self::$autoloadCacheIdentifier)) {
self::$autoloadCacheIdentifier = 'autoload_' . sha1(((TYPO3_version . PATH_site) . 'autoload'));
self::$autoloadCacheIdentifier = 'autoload_' . sha1((TYPO3_version . PATH_site . 'autoload'));
}
return self::$autoloadCacheIdentifier;
}
......
......@@ -85,7 +85,7 @@ abstract class AbstractBackend implements \TYPO3\CMS\Core\Cache\Backend\BackendI
if (method_exists($this, $methodName)) {
$this->{$methodName}($optionValue);
} else {
throw new \InvalidArgumentException(((('Invalid cache backend option "' . $optionKey) . '" for backend of type "') . get_class($this)) . '"', 1231267498);
throw new \InvalidArgumentException('Invalid cache backend option "' . $optionKey . '" for backend of type "' . get_class($this) . '"', 1231267498);
}
}
}
......@@ -132,7 +132,7 @@ abstract class AbstractBackend implements \TYPO3\CMS\Core\Cache\Backend\BackendI
if ($lifetime === NULL) {
$lifetime = $this->defaultLifetime;
}
$expiryTime = new \DateTime(('now +' . $lifetime) . ' seconds', new \DateTimeZone('UTC'));
$expiryTime = new \DateTime('now +' . $lifetime . ' seconds', new \DateTimeZone('UTC'));
}
return $expiryTime;
}
......
......@@ -85,7 +85,7 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
public function setCache(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) {
parent::setCache($cache);
$processUser = extension_loaded('posix') ? posix_getpwuid(posix_geteuid()) : array('name' => 'default');
$pathHash = \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5((PATH_site . $processUser['name']) . $this->context, 12);
$pathHash = \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5(PATH_site . $processUser['name'] . $this->context, 12);
$this->identifierPrefix = 'TYPO3_' . $pathHash;
}
......@@ -106,7 +106,7 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
throw new \TYPO3\CMS\Core\Cache\Exception('No cache frontend has been set yet via setCache().', 1232986818);
}
if (!is_string($data)) {
throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1232986825);
throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1232986825);
}
$tags[] = '%APCBE%' . $this->cacheIdentifier;
$expiration = $lifetime !== NULL ? $lifetime : $this->defaultLifetime;
......@@ -169,7 +169,7 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
*/
public function findIdentifiersByTag($tag) {
$success = FALSE;
$identifiers = apc_fetch(($this->identifierPrefix . 'tag_') . $tag, $success);
$identifiers = apc_fetch($this->identifierPrefix . 'tag_' . $tag, $success);
if ($success === FALSE) {
return array();
} else {
......@@ -186,7 +186,7 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
*/
protected function findTagsByIdentifier($identifier) {
$success = FALSE;
$tags = apc_fetch(($this->identifierPrefix . 'ident_') . $identifier, $success);
$tags = apc_fetch($this->identifierPrefix . 'ident_' . $identifier, $success);
return $success ? (array) $tags : array();
}
......@@ -231,12 +231,12 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
$identifiers = $this->findIdentifiersByTag($tag);
if (array_search($entryIdentifier, $identifiers) === FALSE) {
$identifiers[] = $entryIdentifier;
apc_store(($this->identifierPrefix . 'tag_') . $tag, $identifiers);
apc_store($this->identifierPrefix . 'tag_' . $tag, $identifiers);
}
// Update identifier-to-tag index
$existingTags = $this->findTagsByIdentifier($entryIdentifier);
if (array_search($entryIdentifier, $existingTags) === FALSE) {
apc_store(($this->identifierPrefix . 'ident_') . $entryIdentifier, array_merge($existingTags, $tags));
apc_store($this->identifierPrefix . 'ident_' . $entryIdentifier, array_merge($existingTags, $tags));
}
}
}
......@@ -261,14 +261,14 @@ class ApcBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
if (($key = array_search($entryIdentifier, $identifiers)) !== FALSE) {
unset($identifiers[$key]);
if (count($identifiers)) {
apc_store(($this->identifierPrefix . 'tag_') . $tag, $identifiers);
apc_store($this->identifierPrefix . 'tag_' . $tag, $identifiers);
} else {
apc_delete(($this->identifierPrefix . 'tag_') . $tag);
apc_delete($this->identifierPrefix . 'tag_' . $tag);
}
}
}
// Clear reverse tag index for this identifier
apc_delete(($this->identifierPrefix . 'ident_') . $entryIdentifier);
apc_delete($this->identifierPrefix . 'ident_' . $entryIdentifier);
}
/**
......
......@@ -86,7 +86,7 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
$entryIdentifier = $directoryIterator->getFilename();
}
$this->cacheEntryIdentifiers[$entryIdentifier] = TRUE;
file_put_contents(($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension, $this->get($entryIdentifier));
file_put_contents($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension, $this->get($entryIdentifier));
}
if ($this->useIgBinary === TRUE) {
file_put_contents($this->cacheDirectory . 'FrozenCache.data', igbinary_serialize($this->cacheEntryIdentifiers));
......@@ -147,7 +147,7 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
*/
public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {
if (!is_string($data)) {
throw new \t3lib_cache_Exception_InvalidData(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1204481674);
throw new \t3lib_cache_Exception_InvalidData('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1204481674);
}
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073032);
......@@ -159,22 +159,22 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
throw new \RuntimeException(sprintf('Cannot add or modify cache entry because the backend of cache "%s" is frozen.', $this->cacheIdentifier), 1323344192);
}
$this->remove($entryIdentifier);
$temporaryCacheEntryPathAndFilename = ($this->cacheDirectory . uniqid()) . '.temp';
$temporaryCacheEntryPathAndFilename = $this->cacheDirectory . uniqid() . '.temp';
$lifetime = $lifetime === NULL ? $this->defaultLifetime : $lifetime;
$expiryTime = $lifetime === 0 ? 0 : $GLOBALS['EXEC_TIME'] + $lifetime;
$metaData = (str_pad($expiryTime, self::EXPIRYTIME_LENGTH) . implode(' ', $tags)) . str_pad(strlen($data), self::DATASIZE_DIGITS);
$metaData = str_pad($expiryTime, self::EXPIRYTIME_LENGTH) . implode(' ', $tags) . str_pad(strlen($data), self::DATASIZE_DIGITS);
$result = file_put_contents($temporaryCacheEntryPathAndFilename, $data . $metaData);
\TYPO3\CMS\Core\Utility\GeneralUtility::fixPermissions($temporaryCacheEntryPathAndFilename);
if ($result === FALSE) {
throw new \t3lib_cache_exception(('The temporary cache file "' . $temporaryCacheEntryPathAndFilename) . '" could not be written.', 1204026251);
throw new \t3lib_cache_exception('The temporary cache file "' . $temporaryCacheEntryPathAndFilename . '" could not be written.', 1204026251);
}
$i = 0;
$cacheEntryPathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$cacheEntryPathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
while (($result = rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename)) === FALSE && $i < 5) {
$i++;
}
if ($result === FALSE) {
throw new \t3lib_cache_exception(('The cache file "' . $cacheEntryPathAndFilename) . '" could not be written.', 1222361632);
throw new \t3lib_cache_exception('The cache file "' . $cacheEntryPathAndFilename . '" could not be written.', 1222361632);
}
}
......@@ -188,12 +188,12 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
*/
public function get($entryIdentifier) {
if ($this->frozen === TRUE) {
return isset($this->cacheEntryIdentifiers[$entryIdentifier]) ? file_get_contents(($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension) : FALSE;
return isset($this->cacheEntryIdentifiers[$entryIdentifier]) ? file_get_contents($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension) : FALSE;
}
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073033);
}
$pathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
if ($this->isCacheFileExpired($pathAndFilename)) {
return FALSE;
}
......@@ -216,7 +216,7 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073034);
}
return !$this->isCacheFileExpired((($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension));
return !$this->isCacheFileExpired(($this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension));
}
/**
......@@ -239,7 +239,7 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
if ($this->frozen === TRUE) {
throw new \RuntimeException(sprintf('Cannot remove cache entry because the backend of cache "%s" is frozen.', $this->cacheIdentifier), 1323344193);
}
$pathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
if (file_exists($pathAndFilename) === FALSE) {
return FALSE;
}
......@@ -384,16 +384,16 @@ class FileBackend extends \TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend implem
public function requireOnce($entryIdentifier) {
if ($this->frozen === TRUE) {
if (isset($this->cacheEntryIdentifiers[$entryIdentifier])) {
return require_once ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
return require_once $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
} else {
return FALSE;
}
} else {
$pathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1282073036);
}
$pathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
return $this->isCacheFileExpired($pathAndFilename) ? FALSE : require_once $pathAndFilename;
}
}
......
......@@ -173,7 +173,7 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
*/
public function setCache(\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache) {
parent::setCache($cache);
$this->identifierPrefix = ('TYPO3_' . md5(PATH_site)) . '_';
$this->identifierPrefix = 'TYPO3_' . md5(PATH_site) . '_';
}
/**
......@@ -191,13 +191,13 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
*/
public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {
if (strlen($this->identifierPrefix . $entryIdentifier) > 250) {
throw new \InvalidArgumentException((('Could not set value. Key more than 250 characters (' . $this->identifierPrefix) . $entryIdentifier) . ').', 1232969508);
throw new \InvalidArgumentException('Could not set value. Key more than 250 characters (' . $this->identifierPrefix . $entryIdentifier . ').', 1232969508);
}
if (!$this->cache instanceof \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface) {
throw new \TYPO3\CMS\Core\Cache\Exception('No cache frontend has been set yet via setCache().', 1207149215);
}
if (!is_string($data)) {
throw new \t3lib_cache_Exception_InvalidData(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1207149231);
throw new \t3lib_cache_Exception_InvalidData('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1207149231);
}
$tags[] = '%MEMCACHEBE%' . $this->cacheIdentifier;
$expiration = $lifetime !== NULL ? $lifetime : $this->defaultLifetime;
......@@ -212,7 +212,7 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
$success = TRUE;
$chunkNumber = 1;
foreach ($data as $chunk) {
$success = $success && $this->memcache->set((($this->identifierPrefix . $entryIdentifier) . '_chunk_') . $chunkNumber, $chunk, $this->flags, $expiration);
$success = $success && $this->memcache->set($this->identifierPrefix . $entryIdentifier . '_chunk_' . $chunkNumber, $chunk, $this->flags, $expiration);
$chunkNumber++;
}
$success = $success && $this->memcache->set($this->identifierPrefix . $entryIdentifier, 'TYPO3*chunked:' . $chunkNumber, $this->flags, $expiration);
......@@ -243,7 +243,7 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
list(, $chunkCount) = explode(':', $value);
$value = '';
for ($chunkNumber = 1; $chunkNumber < $chunkCount; $chunkNumber++) {
$value .= $this->memcache->get((($this->identifierPrefix . $entryIdentifier) . '_chunk_') . $chunkNumber);
$value .= $this->memcache->get($this->identifierPrefix . $entryIdentifier . '_chunk_' . $chunkNumber);
}
}
return $value;
......@@ -283,7 +283,7 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
* @api
*/
public function findIdentifiersByTag($tag) {
$identifiers = $this->memcache->get(($this->identifierPrefix . 'tag_') . $tag);
$identifiers = $this->memcache->get($this->identifierPrefix . 'tag_' . $tag);
if ($identifiers !== FALSE) {
return (array) $identifiers;
} else {
......@@ -332,12 +332,12 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
$identifiers = $this->findIdentifiersByTag($tag);
if (array_search($entryIdentifier, $identifiers) === FALSE) {
$identifiers[] = $entryIdentifier;
$this->memcache->set(($this->identifierPrefix . 'tag_') . $tag, $identifiers);
$this->memcache->set($this->identifierPrefix . 'tag_' . $tag, $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));
$this->memcache->set($this->identifierPrefix . 'ident_' . $entryIdentifier, array_merge($existingTags, $tags));
}
}
}
......@@ -363,14 +363,14 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
if (($key = array_search($entryIdentifier, $identifiers)) !== FALSE) {
unset($identifiers[$key]);
if (count($identifiers)) {
$this->memcache->set(($this->identifierPrefix . 'tag_') . $tag, $identifiers);
$this->memcache->set($this->identifierPrefix . 'tag_' . $tag, $identifiers);
} else {
$this->memcache->delete(($this->identifierPrefix . 'tag_') . $tag, 0);
$this->memcache->delete($this->identifierPrefix . 'tag_' . $tag, 0);
}
}
}
// Clear reverse tag index for this identifier
$this->memcache->delete(($this->identifierPrefix . 'ident_') . $entryIdentifier, 0);
$this->memcache->delete($this->identifierPrefix . 'ident_' . $entryIdentifier, 0);
}
/**
......@@ -382,7 +382,7 @@ class MemcachedBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend imp
* @api
*/
protected function findTagsByIdentifier($identifier) {
$tags = $this->memcache->get(($this->identifierPrefix . 'ident_') . $identifier);
$tags = $this->memcache->get($this->identifierPrefix . 'ident_' . $identifier);
return $tags === FALSE ? array() : (array) $tags;
}
......
......@@ -119,7 +119,7 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
throw new \TYPO3\CMS\Core\Cache\Exception('No cache frontend has been set yet via setCache().', 1259515600);
}
if (!is_string($data)) {
throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1259515601);
throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1259515601);
}
if ($this->has($entryIdentifier)) {
$this->remove($entryIdentifier);
......@@ -128,13 +128,13 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
$statementHandle = $this->databaseHandle->prepare('INSERT INTO "cache" ("identifier", "context", "cache", "created", "lifetime", "content") VALUES (?, ?, ?, ?, ?, ?)');
$result = $statementHandle->execute(array($entryIdentifier, $this->context, $this->cacheIdentifier, $GLOBALS['EXEC_TIME'], $lifetime, $data));
if ($result === FALSE) {
throw new \TYPO3\CMS\Core\Cache\Exception(('The cache entry "' . $entryIdentifier) . '" could not be written.', 1259530791);
throw new \TYPO3\CMS\Core\Cache\Exception('The cache entry "' . $entryIdentifier . '" could not be written.', 1259530791);
}
$statementHandle = $this->databaseHandle->prepare('INSERT INTO "tags" ("identifier", "context", "cache", "tag") VALUES (?, ?, ?, ?)');
foreach ($tags as $tag) {
$result = $statementHandle->execute(array($entryIdentifier, $this->context, $this->cacheIdentifier, $tag));
if ($result === FALSE) {
throw new \TYPO3\CMS\Core\Cache\Exception(((('The tag "' . $tag) . ' for cache entry "') . $entryIdentifier) . '" could not be written.', 1259530751);
throw new \TYPO3\CMS\Core\Cache\Exception('The tag "' . $tag . ' for cache entry "' . $entryIdentifier . '" could not be written.', 1259530751);
}
}
}
......@@ -230,7 +230,7 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
* @api
*/
public function collectGarbage() {
$statementHandle = $this->databaseHandle->prepare((('DELETE FROM "tags" WHERE "context"=? AND "cache"=? AND "identifier" IN ' . '(SELECT "identifier" FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ') . $GLOBALS['EXEC_TIME']) . ')');
$statementHandle = $this->databaseHandle->prepare('DELETE FROM "tags" WHERE "context"=? AND "cache"=? AND "identifier" IN ' . '(SELECT "identifier" FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ' . $GLOBALS['EXEC_TIME'] . ')');
$statementHandle->execute(array($this->context, $this->cacheIdentifier, $this->context, $this->cacheIdentifier));
$statementHandle = $this->databaseHandle->prepare('DELETE FROM "cache" WHERE "context"=? AND "cache"=? AND "lifetime" > 0 AND "created" + "lifetime" < ' . $GLOBALS['EXEC_TIME']);
$statementHandle->execute(array($this->context, $this->cacheIdentifier));
......@@ -242,7 +242,7 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
* @return string
*/
protected function getNotExpiredStatement() {
return (' AND ("lifetime" = 0 OR "created" + "lifetime" >= ' . $GLOBALS['EXEC_TIME']) . ')';
return ' AND ("lifetime" = 0 OR "created" + "lifetime" >= ' . $GLOBALS['EXEC_TIME'] . ')';
}
/**
......@@ -266,7 +266,7 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
$this->databaseHandle->exec('SET SESSION sql_mode=\'ANSI\';');
}
} catch (\PDOException $e) {
throw new \RuntimeException((('Could not connect to cache table with DSN "' . $this->dataSourceName) . '". PDO error: ') . $e->getMessage(), 1334736164);
throw new \RuntimeException('Could not connect to cache table with DSN "' . $this->dataSourceName . '". PDO error: ' . $e->getMessage(), 1334736164);
}
}
......@@ -280,7 +280,7 @@ class PdoBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend implement
try {
\TYPO3\CMS\Core\Database\PdoHelper::importSql($this->databaseHandle, $this->pdoDriver, PATH_t3lib . 'cache/backend/resources/ddl.sql');
} catch (\PDOException $e) {
throw new \RuntimeException((('Could not create cache tables with DSN "' . $this->dataSourceName) . '". PDO error: ') . $e->getMessage(), 1259576985);
throw new \RuntimeException('Could not create cache tables with DSN "' . $this->dataSourceName . '". PDO error: ' . $e->getMessage(), 1259576985);
}
}
......
......@@ -163,7 +163,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
if ($this->database > 0) {
$success = $this->redis->select($this->database);
if (!$success) {
throw new \TYPO3\CMS\Core\Cache\Exception(('The given database "' . $this->database) . '" could not be selected.', 1279765144);
throw new \TYPO3\CMS\Core\Cache\Exception('The given database "' . $this->database . '" could not be selected.', 1279765144);
}
}
}
......@@ -201,10 +201,10 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function setDatabase($database) {
if (!is_integer($database)) {
throw new \InvalidArgumentException(('The specified database number is of type "' . gettype($database)) . '" but an integer is expected.', 1279763057);
throw new \InvalidArgumentException('The specified database number is of type "' . gettype($database) . '" but an integer is expected.', 1279763057);
}
if ($database < 0) {
throw new \InvalidArgumentException(('The specified database "' . $database) . '" must be greater or equal than zero.', 1279763534);
throw new \InvalidArgumentException('The specified database "' . $database . '" must be greater or equal than zero.', 1279763534);
}
$this->database = $database;
}
......@@ -230,7 +230,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function setCompression($compression) {
if (!is_bool($compression)) {
throw new \InvalidArgumentException(('The specified compression of type "' . gettype($compression)) . '" but a boolean is expected.', 1289679153);
throw new \InvalidArgumentException('The specified compression of type "' . gettype($compression) . '" but a boolean is expected.', 1289679153);
}
$this->compression = $compression;
}
......@@ -247,7 +247,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function setCompressionLevel($compressionLevel) {
if (!is_integer($compressionLevel)) {
throw new \InvalidArgumentException(('The specified compression of type "' . gettype($compressionLevel)) . '" but an integer is expected.', 1289679154);
throw new \InvalidArgumentException('The specified compression of type "' . gettype($compressionLevel) . '" but an integer is expected.', 1289679154);
}
if ($compressionLevel >= -1 && $compressionLevel <= 9) {
$this->compressionLevel = $compressionLevel;
......@@ -273,17 +273,17 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {
if (!is_string($entryIdentifier)) {
throw new \InvalidArgumentException(('The specified identifier is of type "' . gettype($entryIdentifier)) . '" but a string is expected.', 1279470252);
throw new \InvalidArgumentException('The specified identifier is of type "' . gettype($entryIdentifier) . '" but a string is expected.', 1279470252);
}
if (!is_string($data)) {
throw new \t3lib_cache_Exception_InvalidData(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1279469941);
throw new \t3lib_cache_Exception_InvalidData('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1279469941);
}
$lifetime = $lifetime === NULL ? $this->defaultLifetime : $lifetime;
if (!is_integer($lifetime)) {
throw new \InvalidArgumentException(('The specified lifetime is of type "' . gettype($lifetime)) . '" but an integer or NULL is expected.', 1279488008);
throw new \InvalidArgumentException('The specified lifetime is of type "' . gettype($lifetime) . '" but an integer or NULL is expected.', 1279488008);
}
if ($lifetime < 0) {
throw new \InvalidArgumentException(('The specified lifetime "' . $lifetime) . '" must be greater or equal than zero.', 1279487573);
throw new \InvalidArgumentException('The specified lifetime "' . $lifetime . '" must be greater or equal than zero.', 1279487573);
}
if ($this->connected) {
$expiration = $lifetime === 0 ? self::FAKED_UNLIMITED_LIFETIME : $lifetime;
......@@ -325,7 +325,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function get($entryIdentifier) {
if (!is_string($entryIdentifier)) {
throw new \InvalidArgumentException(('The specified identifier is of type "' . gettype($entryIdentifier)) . '" but a string is expected.', 1279470253);
throw new \InvalidArgumentException('The specified identifier is of type "' . gettype($entryIdentifier) . '" but a string is expected.', 1279470253);
}
$storedEntry = FALSE;
if ($this->connected) {
......@@ -349,7 +349,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function has($entryIdentifier) {
if (!is_string($entryIdentifier)) {
throw new \InvalidArgumentException(('The specified identifier is of type "' . gettype($entryIdentifier)) . '" but a string is expected.', 1279470254);
throw new \InvalidArgumentException('The specified identifier is of type "' . gettype($entryIdentifier) . '" but a string is expected.', 1279470254);
}
return $this->connected && $this->redis->exists(self::IDENTIFIER_DATA_PREFIX . $entryIdentifier);
}
......@@ -367,7 +367,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function remove($entryIdentifier) {
if (!is_string($entryIdentifier)) {
throw new \InvalidArgumentException(('The specified identifier is of type "' . gettype($entryIdentifier)) . '" but a string is expected.', 1279470255);
throw new \InvalidArgumentException('The specified identifier is of type "' . gettype($entryIdentifier) . '" but a string is expected.', 1279470255);
}
$elementsDeleted = FALSE;
if ($this->connected) {
......@@ -399,7 +399,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function findIdentifiersByTag($tag) {
if (!is_string($tag)) {
throw new \InvalidArgumentException(('The specified tag is of type "' . gettype($tag)) . '" but a string is expected.', 1279569759);
throw new \InvalidArgumentException('The specified tag is of type "' . gettype($tag) . '" but a string is expected.', 1279569759);
}
$foundIdentifiers = array();
if ($this->connected) {
......@@ -435,7 +435,7 @@ class RedisBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend impleme
*/
public function flushByTag($tag) {
if (!is_string($tag)) {
throw new \InvalidArgumentException(('The specified tag is of type "' . gettype($tag)) . '" but a string is expected.', 1279578078);
throw new \InvalidArgumentException('The specified tag is of type "' . gettype($tag) . '" but a string is expected.', 1279578078);
}
if ($this->connected) {
$identifiers = $this->redis->sMembers(self::TAG_IDENTIFIERS_PREFIX . $tag);
......
......@@ -98,7 +98,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
$temporaryCacheDirectory = $this->temporaryCacheDirectory;
}
$codeOrData = $cache instanceof \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend ? 'Code' : 'Data';
$finalCacheDirectory = (((($temporaryCacheDirectory . 'Cache/') . $codeOrData) . '/') . $this->cacheIdentifier) . '/';
$finalCacheDirectory = $temporaryCacheDirectory . 'Cache/' . $codeOrData . '/' . $this->cacheIdentifier . '/';
if (!is_dir($finalCacheDirectory)) {
$this->createFinalCacheDirectory($finalCacheDirectory);
}
......@@ -106,7 +106,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
$this->cacheDirectory = $finalCacheDirectory;
$this->cacheEntryFileExtension = $cache instanceof \TYPO3\CMS\Core\Cache\Frontend\PhpFrontend ? '.php' : '';
if (strlen($this->cacheDirectory) + 23 > \TYPO3\CMS\Core\Utility\GeneralUtility::getMaximumPathLength()) {
throw new \TYPO3\CMS\Core\Cache\Exception(((((('The length of the temporary cache file path "' . $this->cacheDirectory) . '" exceeds the ') . 'maximum path length of ') . (\TYPO3\CMS\Core\Utility\GeneralUtility::getMaximumPathLength() - 23)) . '. Please consider ') . 'setting the temporaryDirectoryBase option to a shorter path.', 1248710426);
throw new \TYPO3\CMS\Core\Cache\Exception('The length of the temporary cache file path "' . $this->cacheDirectory . '" exceeds the ' . 'maximum path length of ' . (\TYPO3\CMS\Core\Utility\GeneralUtility::getMaximumPathLength() - 23) . '. Please consider ' . 'setting the temporaryDirectoryBase option to a shorter path.', 1248710426);
}
}
......@@ -164,7 +164,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
}
}
if (!$cacheDirectoryInBaseDir) {
throw new \TYPO3\CMS\Core\Cache\Exception(('Open_basedir restriction in effect. The directory "' . $cacheDirectory) . '" is not in an allowed path.');
throw new \TYPO3\CMS\Core\Cache\Exception('Open_basedir restriction in effect. The directory "' . $cacheDirectory . '" is not in an allowed path.');
}
} else {
if ($cacheDirectory[0] == '/') {
......@@ -181,7 +181,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
if ($cacheDirectory[strlen($cacheDirectory) - 1] !== '/') {
$cacheDirectory .= '/';
}
$this->temporaryCacheDirectory = (($documentRoot . $cacheDirectory) . $this->cacheIdentifier) . '/';
$this->temporaryCacheDirectory = $documentRoot . $cacheDirectory . $this->cacheIdentifier . '/';
}
/**
......@@ -196,10 +196,10 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
try {
\TYPO3\CMS\Core\Utility\GeneralUtility::mkdir_deep($finalCacheDirectory);
} catch (\RuntimeException $e) {
throw new \TYPO3\CMS\Core\Cache\Exception(('The directory "' . $finalCacheDirectory) . '" can not be created.', 1303669848, $e);
throw new \TYPO3\CMS\Core\Cache\Exception('The directory "' . $finalCacheDirectory . '" can not be created.', 1303669848, $e);
}
if (!is_writable($finalCacheDirectory)) {
throw new \TYPO3\CMS\Core\Cache\Exception(('The directory "' . $finalCacheDirectory) . '" is not writable.', 1203965200);
throw new \TYPO3\CMS\Core\Cache\Exception('The directory "' . $finalCacheDirectory . '" is not writable.', 1203965200);
}
}
......@@ -228,7 +228,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
*/
public function set($entryIdentifier, $data, array $tags = array(), $lifetime = NULL) {
if (!is_string($data)) {
throw new \t3lib_cache_Exception_InvalidData(('The specified data is of type "' . gettype($data)) . '" but a string is expected.', 1334756734);
throw new \t3lib_cache_Exception_InvalidData('The specified data is of type "' . gettype($data) . '" but a string is expected.', 1334756734);
}
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1334756735);
......@@ -236,13 +236,13 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
if ($entryIdentifier === '') {
throw new \InvalidArgumentException('The specified entry identifier must not be empty.', 1334756736);
}
$temporaryCacheEntryPathAndFilename = ($this->cacheDirectory . uniqid()) . '.temp';
$temporaryCacheEntryPathAndFilename = $this->cacheDirectory . uniqid() . '.temp';
$result = file_put_contents($temporaryCacheEntryPathAndFilename, $data);
\TYPO3\CMS\Core\Utility\GeneralUtility::fixPermissions($temporaryCacheEntryPathAndFilename);
if ($result === FALSE) {
throw new \TYPO3\CMS\Core\Cache\Exception(('The temporary cache file "' . $temporaryCacheEntryPathAndFilename) . '" could not be written.', 1334756737);
throw new \TYPO3\CMS\Core\Cache\Exception('The temporary cache file "' . $temporaryCacheEntryPathAndFilename . '" could not be written.', 1334756737);
}
$cacheEntryPathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$cacheEntryPathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;
rename($temporaryCacheEntryPathAndFilename, $cacheEntryPathAndFilename);
}
......@@ -258,7 +258,7 @@ class SimpleFileBackend extends \TYPO3\CMS\Core\Cache\Backend\AbstractBackend im
if ($entryIdentifier !== basename($entryIdentifier)) {
throw new \InvalidArgumentException('The specified entry identifier must not contain a path segment.', 1334756877);
}
$pathAndFilename = ($this->cacheDirectory . $entryIdentifier) . $this->cacheEntryFileExtension;
$pathAndFilename = $this->cacheDirectory . $entryIdentifier . $this->cacheEntryFileExtension;