diff --git a/typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php b/typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php index cf9829377ed1f0088f58bdfc20a1293da0c6fd38..089cce61727a2a7efe3810464e27442ca3ae6583 100644 --- a/typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php +++ b/typo3/sysext/core/Classes/Cache/Frontend/AbstractFrontend.php @@ -13,6 +13,11 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Cache\Backend\AbstractBackend; +use TYPO3\CMS\Core\Cache\Backend\BackendInterface; +use TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface; +use TYPO3\CMS\Core\Utility\GeneralUtility; + /** * An abstract cache * @@ -22,7 +27,7 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * @author Karsten Dambekalns <karsten@typo3.org> * @api */ -abstract class AbstractFrontend implements \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface { +abstract class AbstractFrontend implements FrontendInterface { /** * Identifies this cache @@ -32,7 +37,7 @@ abstract class AbstractFrontend implements \TYPO3\CMS\Core\Cache\Frontend\Fronte protected $identifier; /** - * @var \TYPO3\CMS\Core\Cache\Backend\AbstractBackend|\TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface + * @var AbstractBackend|TaggableBackendInterface */ protected $backend; @@ -40,10 +45,10 @@ abstract class AbstractFrontend implements \TYPO3\CMS\Core\Cache\Frontend\Fronte * Constructs the cache * * @param string $identifier A identifier which describes this cache - * @param \TYPO3\CMS\Core\Cache\Backend\BackendInterface $backend Backend to be used for this cache + * @param BackendInterface $backend Backend to be used for this cache * @throws \InvalidArgumentException if the identifier doesn't match PATTERN_ENTRYIDENTIFIER */ - public function __construct($identifier, \TYPO3\CMS\Core\Cache\Backend\BackendInterface $backend) { + public function __construct($identifier, BackendInterface $backend) { if (preg_match(self::PATTERN_ENTRYIDENTIFIER, $identifier) !== 1) { throw new \InvalidArgumentException('"' . $identifier . '" is not a valid cache identifier.', 1203584729); } @@ -65,7 +70,7 @@ abstract class AbstractFrontend implements \TYPO3\CMS\Core\Cache\Frontend\Fronte /** * Returns the backend used by this cache * - * @return \TYPO3\CMS\Core\Cache\Backend\BackendInterface The backend used by this cache + * @return BackendInterface The backend used by this cache * @api */ public function getBackend() { @@ -127,10 +132,10 @@ abstract class AbstractFrontend implements \TYPO3\CMS\Core\Cache\Frontend\Fronte if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'])) { foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/cache/frontend/class.t3lib_cache_frontend_abstractfrontend.php']['flushByTag'] as $_funcRef) { $params = array('tag' => $tag); - \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($_funcRef, $params, $this); + GeneralUtility::callUserFunction($_funcRef, $params, $this); } } - if ($this->backend instanceof \TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface) { + if ($this->backend instanceof TaggableBackendInterface) { $this->backend->flushByTag($tag); } } diff --git a/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php b/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php index fd25aed8c6da3eac4a7d4e765e53c6be20f034f5..e9e1fc6aa831683926a71db7b8189d2433c3b519 100644 --- a/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php +++ b/typo3/sysext/core/Classes/Cache/Frontend/PhpFrontend.php @@ -13,6 +13,9 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface; +use TYPO3\CMS\Core\Cache\Exception\InvalidDataException; + /** * A cache frontend tailored to PHP code. * @@ -21,15 +24,15 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * @author Robert Lemke <robert@typo3.org> * @api */ -class PhpFrontend extends \TYPO3\CMS\Core\Cache\Frontend\StringFrontend { +class PhpFrontend extends StringFrontend { /** * Constructs the cache * * @param string $identifier A identifier which describes this cache - * @param \TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface $backend Backend to be used for this cache + * @param PhpCapableBackendInterface $backend Backend to be used for this cache */ - public function __construct($identifier, \TYPO3\CMS\Core\Cache\Backend\PhpCapableBackendInterface $backend) { + public function __construct($identifier, PhpCapableBackendInterface $backend) { parent::__construct($identifier, $backend); } @@ -42,7 +45,7 @@ class PhpFrontend extends \TYPO3\CMS\Core\Cache\Frontend\StringFrontend { * @param int $lifetime Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime. * @return void * @throws \InvalidArgumentException If $entryIdentifier or $tags is invalid - * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidDataException If $sourceCode is not a string + * @throws InvalidDataException If $sourceCode is not a string * @api */ public function set($entryIdentifier, $sourceCode, array $tags = array(), $lifetime = NULL) { @@ -50,7 +53,7 @@ class PhpFrontend extends \TYPO3\CMS\Core\Cache\Frontend\StringFrontend { throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1264023823); } if (!is_string($sourceCode)) { - throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException('The given source code is not a valid string.', 1264023824); + throw new InvalidDataException('The given source code is not a valid string.', 1264023824); } foreach ($tags as $tag) { if (!$this->isValidTag($tag)) { diff --git a/typo3/sysext/core/Classes/Cache/Frontend/StringFrontend.php b/typo3/sysext/core/Classes/Cache/Frontend/StringFrontend.php index b4bedeb17caf3a6680d964b7b75b617780b128d2..9a58bd28b42b2c6022a97cbcb7e7afdcae70f07a 100644 --- a/typo3/sysext/core/Classes/Cache/Frontend/StringFrontend.php +++ b/typo3/sysext/core/Classes/Cache/Frontend/StringFrontend.php @@ -13,6 +13,8 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Cache\Exception\InvalidDataException; + /** * A cache frontend for strings. Nothing else. * @@ -21,7 +23,7 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * @author Karsten Dambekalns <karsten@typo3.org> * @api */ -class StringFrontend extends \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend { +class StringFrontend extends AbstractFrontend { /** * Saves the value of a PHP variable in the cache. @@ -32,7 +34,7 @@ class StringFrontend extends \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend { * @param int $lifetime Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime. * @return void * @throws \InvalidArgumentException if the identifier or tag is not valid - * @throws \TYPO3\CMS\Core\Cache\Exception\InvalidDataException if the variable to cache is not of type string + * @throws InvalidDataException if the variable to cache is not of type string * @api */ public function set($entryIdentifier, $string, array $tags = array(), $lifetime = NULL) { @@ -40,7 +42,7 @@ class StringFrontend extends \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend { throw new \InvalidArgumentException('"' . $entryIdentifier . '" is not a valid cache entry identifier.', 1233057566); } if (!is_string($string)) { - throw new \TYPO3\CMS\Core\Cache\Exception\InvalidDataException('Given data is of type "' . gettype($string) . '", but a string is expected for string cache.', 1222808333); + throw new InvalidDataException('Given data is of type "' . gettype($string) . '", but a string is expected for string cache.', 1222808333); } foreach ($tags as $tag) { if (!$this->isValidTag($tag)) { diff --git a/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php b/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php index 19d5005fedc6cfab6f9642b27a7f91f5ff04ce0b..6b9924d5edae5d7ccb78db85b6f95b90a98b91de 100644 --- a/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php +++ b/typo3/sysext/core/Classes/Cache/Frontend/VariableFrontend.php @@ -13,6 +13,8 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * * The TYPO3 project - inspiring people to share! */ +use TYPO3\CMS\Core\Utility\GeneralUtility; + /** * A cache frontend for any kinds of PHP variables * @@ -22,7 +24,7 @@ namespace TYPO3\CMS\Core\Cache\Frontend; * @author Karsten Dambekalns <karsten@typo3.org> * @api */ -class VariableFrontend extends \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend { +class VariableFrontend extends AbstractFrontend { /** * If the extension "igbinary" is installed, use it for increased performance. @@ -70,7 +72,7 @@ class VariableFrontend extends \TYPO3\CMS\Core\Cache\Frontend\AbstractFrontend { 'tags' => &$tags, 'lifetime' => &$lifetime ); - \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($_funcRef, $params, $this); + GeneralUtility::callUserFunction($_funcRef, $params, $this); } } if ($this->useIgBinary === TRUE) {