PHP Class Snc\RedisBundle\Profiler\Storage\RedisProfilerStorage

This class is a reimplementation of the RedisProfilerStorage class from Symfony 2.8
Author: Andrej Hudec ([email protected])
Author: Stephane PY ([email protected])
Author: Gijs van Lammeren ([email protected])
Inheritance: implements Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface
ファイルを表示 Open project: snc/SncRedisBundle

Protected Properties

Property Type Description
$lifetime integer TTL for profiler data (in seconds).
$redis Predis\Client | Redis The redis client.

Public Methods

Method Description
__construct ( Client | Redis $redis, integer $lifetime = 86400 ) Constructor.
find ( $ip, $url, $limit, $method, $start = null, $end = null )
purge ( )
read ( $token )
write ( Symfony\Component\HttpKernel\Profiler\Profile $profile )

Protected Methods

Method Description
appendValue ( string $key, string $value, integer $expiration ) : boolean Appends data to an existing item on the Redis server.
createProfileFromData ( string $token, array $data, Symfony\Component\HttpKernel\Profiler\Profile $parent = null ) : Symfony\Component\HttpKernel\Profiler\Profile Creates a Profile.
delete ( array $keys ) : boolean Removes the specified keys.
getIndexName ( ) : string Gets the name of the index.
getItemName ( string $token ) : string Gets the item name.
getValue ( string $key, integer $serializer = self::REDIS_SERIALIZER_NONE ) : mixed Retrieves an item from the Redis server.
isItemNameValid ( string $name ) : boolean Check if the item name is valid.
prefixKey ( string $key ) : string Prefixes the key.
setValue ( string $key, mixed $value, integer $expiration, integer $serializer = self::REDIS_SERIALIZER_NONE ) : boolean Stores an item on the Redis server under the specified key.

Method Details

__construct() public method

Constructor.
public __construct ( Client | Redis $redis, integer $lifetime = 86400 )
$redis Predis\Client | Redis Redis database connection
$lifetime integer The lifetime to use for the purge

appendValue() protected method

Appends data to an existing item on the Redis server.
protected appendValue ( string $key, string $value, integer $expiration ) : boolean
$key string
$value string
$expiration integer
return boolean

createProfileFromData() protected method

Creates a Profile.
protected createProfileFromData ( string $token, array $data, Symfony\Component\HttpKernel\Profiler\Profile $parent = null ) : Symfony\Component\HttpKernel\Profiler\Profile
$token string
$data array
$parent Symfony\Component\HttpKernel\Profiler\Profile
return Symfony\Component\HttpKernel\Profiler\Profile

delete() protected method

Removes the specified keys.
protected delete ( array $keys ) : boolean
$keys array
return boolean

find() public method

public find ( $ip, $url, $limit, $method, $start = null, $end = null )

getIndexName() protected method

Gets the name of the index.
protected getIndexName ( ) : string
return string

getItemName() protected method

Gets the item name.
protected getItemName ( string $token ) : string
$token string
return string

getValue() protected method

Retrieves an item from the Redis server.
protected getValue ( string $key, integer $serializer = self::REDIS_SERIALIZER_NONE ) : mixed
$key string
$serializer integer
return mixed

isItemNameValid() protected method

Check if the item name is valid.
protected isItemNameValid ( string $name ) : boolean
$name string
return boolean

prefixKey() protected method

Prefixes the key.
protected prefixKey ( string $key ) : string
$key string
return string

purge() public method

public purge ( )

read() public method

public read ( $token )

setValue() protected method

Stores an item on the Redis server under the specified key.
protected setValue ( string $key, mixed $value, integer $expiration, integer $serializer = self::REDIS_SERIALIZER_NONE ) : boolean
$key string
$value mixed
$expiration integer
$serializer integer
return boolean

write() public method

public write ( Symfony\Component\HttpKernel\Profiler\Profile $profile )
$profile Symfony\Component\HttpKernel\Profiler\Profile

Property Details

$lifetime protected_oe property

TTL for profiler data (in seconds).
protected int $lifetime
return integer

$redis protected_oe property

The redis client.
protected Client,Predis|Redis $redis
return Predis\Client | Redis