TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Cache\Backend\PdoBackend Class Reference
Inheritance diagram for TYPO3\CMS\Core\Cache\Backend\PdoBackend:
TYPO3\CMS\Core\Cache\Backend\AbstractBackend TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface TYPO3\CMS\Core\Cache\Backend\BackendInterface TYPO3\CMS\Core\Cache\Backend\BackendInterface t3lib_cache_backend_PdoBackend

Public Member Functions

 setDataSourceName ($DSN)
 
 setUsername ($username)
 
 setPassword ($password)
 
 initializeObject ()
 
 set ($entryIdentifier, $data, array $tags=array(), $lifetime=NULL)
 
 get ($entryIdentifier)
 
 has ($entryIdentifier)
 
 remove ($entryIdentifier)
 
 flush ()
 
 flushByTag ($tag)
 
 findIdentifiersByTag ($tag)
 
 collectGarbage ()
 
- Public Member Functions inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 __construct ($context, array $options=array())
 
 setCache (\TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache)
 
 setDefaultLifetime ($defaultLifetime)
 

Protected Member Functions

 getNotExpiredStatement ()
 
 connect ()
 
 createCacheTables ()
 
- Protected Member Functions inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 calculateExpiryTime ($lifetime=NULL)
 

Protected Attributes

 $dataSourceName
 
 $username
 
 $password
 
 $databaseHandle
 
 $pdoDriver
 
- Protected Attributes inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
 $cache
 
 $cacheIdentifier
 
 $context
 
 $defaultLifetime = 3600
 

Additional Inherited Members

- Public Attributes inherited from TYPO3\CMS\Core\Cache\Backend\AbstractBackend
const DATETIME_EXPIRYTIME_UNLIMITED = '9999-12-31T23:59:59+0000'
 
const UNLIMITED_LIFETIME = 0
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A PDO database cache backend

Author
Christian Kuhn lolli.nosp@m.@sch.nosp@m.warzb.nosp@m.u.ch
Karsten Dambekalns karst.nosp@m.en@t.nosp@m.ypo3..nosp@m.org

Definition at line 23 of file PdoBackend.php.

Member Function Documentation

◆ collectGarbage()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::collectGarbage ( )

Does garbage collection

Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 218 of file PdoBackend.php.

References $GLOBALS.

◆ connect()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::connect ( )
protected

◆ createCacheTables()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::createCacheTables ( )
protected

Creates the tables needed for the cache backend.

Returns
void
Exceptions

Definition at line 265 of file PdoBackend.php.

References TYPO3\CMS\Core\Database\PdoHelper\importSql().

Referenced by TYPO3\CMS\Core\Cache\Backend\PdoBackend\connect().

◆ findIdentifiersByTag()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::findIdentifiersByTag (   $tag)

Finds and returns all cache entry identifiers which are tagged by the specified tag.

Parameters
string$tagThe tag to search for
Returns
array An array with identifiers of all matching entries. An empty array if no entries matched

Implements TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface.

Definition at line 206 of file PdoBackend.php.

◆ flush()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::flush ( )

Removes all cache entries of this cache.

Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 177 of file PdoBackend.php.

◆ flushByTag()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::flushByTag (   $tag)

Removes all cache entries of this cache which are tagged by the specified tag.

Parameters
string$tagThe tag the entries must have
Returns
void

Implements TYPO3\CMS\Core\Cache\Backend\TaggableBackendInterface.

Definition at line 191 of file PdoBackend.php.

◆ get()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::get (   $entryIdentifier)

Loads data from the cache.

Parameters
string$entryIdentifierAn identifier which describes the cache entry to load
Returns
mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 135 of file PdoBackend.php.

References TYPO3\CMS\Core\Cache\Backend\PdoBackend\getNotExpiredStatement().

◆ getNotExpiredStatement()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::getNotExpiredStatement ( )
protected

Returns an SQL statement that evaluates to TRUE if the entry is not expired.

Returns
string

Definition at line 230 of file PdoBackend.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\Cache\Backend\PdoBackend\get(), and TYPO3\CMS\Core\Cache\Backend\PdoBackend\has().

◆ has()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::has (   $entryIdentifier)

Checks if a cache entry with the specified identifier exists.

Parameters
string$entryIdentifierAn identifier specifying the cache entry
Returns
boolean TRUE if such an entry exists, FALSE if not

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 148 of file PdoBackend.php.

References TYPO3\CMS\Core\Cache\Backend\PdoBackend\getNotExpiredStatement().

◆ initializeObject()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::initializeObject ( )

Initialize the cache backend.

Returns
void

Definition at line 88 of file PdoBackend.php.

References TYPO3\CMS\Core\Cache\Backend\PdoBackend\connect().

◆ remove()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::remove (   $entryIdentifier)

Removes all cache entries matching the specified identifier. Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.

Parameters
string$entryIdentifierSpecifies the cache entry to remove
Returns
boolean TRUE if (at least) an entry could be removed or FALSE if no entry was found

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 163 of file PdoBackend.php.

◆ set()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::set (   $entryIdentifier,
  $data,
array  $tags = array(),
  $lifetime = NULL 
)

Saves data in the cache.

Parameters
string$entryIdentifierAn identifier for this specific cache entry
string$dataThe data to be stored
array$tagsTags to associate with this cache entry
integer$lifetimeLifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited liftime.
Returns
void
Exceptions

Implements TYPO3\CMS\Core\Cache\Backend\BackendInterface.

Definition at line 105 of file PdoBackend.php.

References $GLOBALS, and $result.

◆ setDataSourceName()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::setDataSourceName (   $DSN)

Sets the DSN to use

Parameters
string$DSNThe DSN to use for connecting to the DB
Returns
void

Definition at line 57 of file PdoBackend.php.

◆ setPassword()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::setPassword (   $password)

Sets the password to use

Parameters
string$passwordThe password to use for connecting to the DB
Returns
void

Definition at line 79 of file PdoBackend.php.

References TYPO3\CMS\Core\Cache\Backend\PdoBackend\$password.

◆ setUsername()

TYPO3\CMS\Core\Cache\Backend\PdoBackend::setUsername (   $username)

Sets the username to use

Parameters
string$usernameThe username to use for connecting to the DB
Returns
void

Definition at line 68 of file PdoBackend.php.

References TYPO3\CMS\Core\Cache\Backend\PdoBackend\$username.

Member Data Documentation

◆ $databaseHandle

TYPO3\CMS\Core\Cache\Backend\PdoBackend::$databaseHandle
protected

Definition at line 43 of file PdoBackend.php.

◆ $dataSourceName

TYPO3\CMS\Core\Cache\Backend\PdoBackend::$dataSourceName
protected

Definition at line 28 of file PdoBackend.php.

◆ $password

TYPO3\CMS\Core\Cache\Backend\PdoBackend::$password
protected

Definition at line 38 of file PdoBackend.php.

Referenced by TYPO3\CMS\Core\Cache\Backend\PdoBackend\setPassword().

◆ $pdoDriver

TYPO3\CMS\Core\Cache\Backend\PdoBackend::$pdoDriver
protected

Definition at line 48 of file PdoBackend.php.

◆ $username

TYPO3\CMS\Core\Cache\Backend\PdoBackend::$username
protected

Definition at line 33 of file PdoBackend.php.

Referenced by TYPO3\CMS\Core\Cache\Backend\PdoBackend\setUsername().