PHP 클래스 Neos\Cache\Backend\RedisBackend

Redis is a noSQL database with very good scaling characteristics in proportion to the amount of entries and data size.
또한 보기: http://redis.io/
또한 보기: https://github.com/nicolasff/phpredis Available backend options: - defaultLifetime: The default lifetime of a cache entry - hostname: The hostname (or socket filepath) of the redis server - port: The TCP port of the redis server (will be ignored if connecting to a socket) - database: The database index that will be used. By default, Redis has 16 databases with index number 0 - 15 Requirements: - Redis 2.6.0+ (tested with 2.6.14 and 2.8.5) - phpredis with Redis 2.6 support, e.g. 2.2.4 (tested with 92782639b0329ff91658a0602a3d816446a3663d from 2014-01-06) Implementation based on ext:rediscache by Christopher Hlubek - networkteam GmbH Each Redis key contains a prefix built from the cache identifier, so one single database can be used for different caches. Cache entry data is stored in a simple key. Tags are stored in Sets. Since Redis < 2.8.0 does not provide a mechanism for iterating over keys, a separate list with all entries is populated
상속: extends AbstractBackend, implements Neos\Cache\Backend\TaggableBackendInterface, implements IterableBackendInterface, implements Neos\Cache\Backend\FreezableBackendInterface, implements Neos\Cache\Backend\PhpCapableBackendInterface, use trait RequireOnceFromValueTrait
파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$compressionLevel integer
$database integer
$entryCursor Cursor used for iterating over cache entries
$frozen boolean
$hostname string
$port integer
$redis Redis

공개 메소드들

메소드 설명
__construct ( EnvironmentConfiguration $environmentConfiguration, array $options ) Constructs this backend
collectGarbage ( ) : void This backend does not need an externally triggered garbage collection
current ( )
findIdentifiersByTag ( string $tag ) : array Finds and returns all cache entry identifiers which are tagged by the specified tag.
flush ( ) : void Removes all cache entries of this cache
flushByTag ( string $tag ) : integer Removes all cache entries of this cache which are tagged by the specified tag.
freeze ( ) : void Freezes this cache backend.
get ( string $entryIdentifier ) : mixed Loads data from the cache.
has ( string $entryIdentifier ) : boolean Checks if a cache entry with the specified identifier exists.
isFrozen ( ) : boolean Tells if this backend is frozen.
key ( )
next ( )
remove ( string $entryIdentifier ) : boolean Removes all cache entries matching the specified identifier.
rewind ( )
set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void Saves data in the cache.
setCompressionLevel ( integer $compressionLevel )
setDatabase ( integer $database ) Sets the database that will be used for this backend
setDefaultLifetime ( integer $lifetime ) : void Sets the default lifetime for this cache backend
setHostname ( string $hostname ) Sets the hostname or the socket of the Redis server
setPort ( string $port ) Sets the port of the Redis server.
setRedis ( Redis $redis = null )
valid ( )

보호된 메소드들

메소드 설명
verifyRedisVersionIsSupported ( ) : void

비공개 메소드들

메소드 설명
buildKey ( $identifier ) : string
compress ( string $value ) : string
getRedisClient ( ) : Redis
uncompress ( string $value ) : string
useCompression ( ) : boolean

메소드 상세

__construct() 공개 메소드

Constructs this backend
public __construct ( EnvironmentConfiguration $environmentConfiguration, array $options )
$environmentConfiguration Neos\Cache\EnvironmentConfiguration
$options array Configuration options - depends on the actual backend

collectGarbage() 공개 메소드

This backend does not need an externally triggered garbage collection
public collectGarbage ( ) : void
리턴 void

current() 공개 메소드

public current ( )

findIdentifiersByTag() 공개 메소드

Finds and returns all cache entry identifiers which are tagged by the specified tag.
public findIdentifiersByTag ( string $tag ) : array
$tag string The tag to search for
리턴 array An array with identifiers of all matching entries. An empty array if no entries matched

flush() 공개 메소드

The flush method will use the EVAL command to flush all entries and tags for this cache in an atomic way.
public flush ( ) : void
리턴 void

flushByTag() 공개 메소드

Removes all cache entries of this cache which are tagged by the specified tag.
public flushByTag ( string $tag ) : integer
$tag string The tag the entries must have
리턴 integer The number of entries which have been affected by this flush

freeze() 공개 메소드

All data in a frozen backend remains unchanged and methods which try to add or modify data result in an exception thrown. Possible expiry times of individual cache entries are ignored. A frozen backend can only be thawn by calling the flush() method.
public freeze ( ) : void
리턴 void

get() 공개 메소드

Loads data from the cache.
public get ( string $entryIdentifier ) : mixed
$entryIdentifier string An identifier which describes the cache entry to load
리턴 mixed The cache entry's content as a string or FALSE if the cache entry could not be loaded

has() 공개 메소드

Checks if a cache entry with the specified identifier exists.
public has ( string $entryIdentifier ) : boolean
$entryIdentifier string An identifier specifying the cache entry
리턴 boolean TRUE if such an entry exists, FALSE if not

isFrozen() 공개 메소드

Tells if this backend is frozen.
public isFrozen ( ) : boolean
리턴 boolean

key() 공개 메소드

public key ( )

next() 공개 메소드

public next ( )

remove() 공개 메소드

Usually this only affects one entry but if - for what reason ever - old entries for the identifier still exist, they are removed as well.
public remove ( string $entryIdentifier ) : boolean
$entryIdentifier string Specifies the cache entry to remove
리턴 boolean TRUE if (at least) an entry could be removed or FALSE if no entry was found

rewind() 공개 메소드

public rewind ( )

set() 공개 메소드

Saves data in the cache.
public set ( string $entryIdentifier, string $data, array $tags = [], integer $lifetime = null ) : void
$entryIdentifier string An identifier for this specific cache entry
$data string The data to be stored
$tags array Tags to associate with this cache entry. If the backend does not support tags, this option can be ignored.
$lifetime integer Lifetime of this cache entry in seconds. If NULL is specified, the default lifetime is used. "0" means unlimited lifetime.
리턴 void

setCompressionLevel() 공개 메소드

public setCompressionLevel ( integer $compressionLevel )
$compressionLevel integer

setDatabase() 공개 메소드

Sets the database that will be used for this backend
public setDatabase ( integer $database )
$database integer Database that will be used

setDefaultLifetime() 공개 메소드

Sets the default lifetime for this cache backend
public setDefaultLifetime ( integer $lifetime ) : void
$lifetime integer Default lifetime of this cache backend in seconds. If NULL is specified, the default lifetime is used. 0 means unlimited lifetime.
리턴 void

setHostname() 공개 메소드

Sets the hostname or the socket of the Redis server
public setHostname ( string $hostname )
$hostname string Hostname of the Redis server

setPort() 공개 메소드

Leave this empty if you want to connect to a socket
public setPort ( string $port )
$port string Port of the Redis server

setRedis() 공개 메소드

public setRedis ( Redis $redis = null )
$redis Redis

valid() 공개 메소드

public valid ( )

verifyRedisVersionIsSupported() 보호된 메소드

protected verifyRedisVersionIsSupported ( ) : void
리턴 void

프로퍼티 상세

$compressionLevel 보호되어 있는 프로퍼티

protected int $compressionLevel
리턴 integer

$database 보호되어 있는 프로퍼티

protected int $database
리턴 integer

$entryCursor 보호되어 있는 프로퍼티

Cursor used for iterating over cache entries
protected $entryCursor

$frozen 보호되어 있는 프로퍼티

protected bool $frozen
리턴 boolean

$hostname 보호되어 있는 프로퍼티

protected string $hostname
리턴 string

$port 보호되어 있는 프로퍼티

protected int $port
리턴 integer

$redis 보호되어 있는 프로퍼티

protected Redis $redis
리턴 Redis