Secciones

Abstract Class Phalcon\Storage\Adapter\AbstractAdapter

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, DateTime, Exception, Phalcon\Storage\Serializer\SerializerInterface, Phalcon\Storage\SerializerFactory, Phalcon\Support\Exception   Implements AdapterInterface

Class AbstractAdapter

Propiedades

/**
 * @var mixed
 */
protected adapter;

/**
 * Name of the default serializer class
 *
 * @var string
 */
protected defaultSerializer = php;

/**
 * Name of the default TTL (time to live)
 *
 * @var int
 */
protected lifetime = 3600;

/**
 * @var array
 */
protected options;

/**
 * @var string
 */
protected prefix = ph-memo-;

/**
 * Serializer
 *
 * @var SerializerInterface|null
 */
protected serializer;

/**
 * Serializer Factory
 *
 * @var SerializerFactory
 */
protected serializerFactory;

Métodos

protected function __construct( SerializerFactory $factory, array $options = [] );

AbstractAdapter constructor.

abstract public function clear(): bool;

Vacía/Limpia la caché

abstract public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

abstract public function delete( string $key ): bool;

Borra datos desde el adaptador

public function get( string $key, mixed $defaultValue = null ): mixed;

Lee datos desde el adaptador

public function getAdapter(): mixed;

Devuelve el adaptador - se conecta al almacenamiento si no está conectado

public function getDefaultSerializer(): string;

Name of the default serializer class

abstract public function getKeys( string $prefix = string ): array;

Devuelve todas las claves almacenadas

public function getPrefix(): string;

Returns the prefix

abstract public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

abstract public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

abstract public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador

public function setDefaultSerializer( string $serializer ): void;
protected function doGet( string $key );
protected function getArrVal( array $collection, mixed $index, mixed $defaultValue = null, string $cast = null ): mixed;

@todo Remove this when we get traits

protected function getFilteredKeys( mixed $keys, string $prefix ): array;

Filtra el vector de claves basado en global y el prefijo pasado

protected function getPrefixedKey( mixed $key ): string;

Devuelve la clave solicitada, prefijada

protected function getSerializedData( mixed $content ): mixed;

Devuelve datos serializados

protected function getTtl( mixed $ttl ): int;

Calcula el TTL para un elemento de caché

protected function getUnserializedData( mixed $content, mixed $defaultValue = null ): mixed;

Devuelve datos sin serializar

protected function initSerializer(): void;

Inicializa el serializador

@throws SupportException

Interface Phalcon\Storage\Adapter\AdapterInterface

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses Phalcon\Storage\Serializer\SerializerInterface

Interfaz para adaptadores Phalcon\Logger

Métodos

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Borra datos desde el adaptador

public function get( string $key, mixed $defaultValue = null ): mixed;

Lee datos desde el adaptador

public function getAdapter(): mixed;

Devuelve el adaptador ya conectado o conecta al/los servidor/es de backend

public function getKeys( string $prefix = string ): array;

Devuelve todas las claves almacenadas

public function getPrefix(): string;

Devuelve el prefijo de las claves

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

Class Phalcon\Storage\Adapter\Apcu

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses APCuIterator, DateInterval, Exception, Phalcon\Storage\SerializerFactory, Phalcon\Support\Exception   Extends AbstractAdapter

Adaptador Apcu

Propiedades

/**
 * @var string
 */
protected prefix = ph-apcu-;

Métodos

public function __construct( SerializerFactory $factory, array $options = [] );

Apcu constructor.

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Lee datos desde el adaptador

public function getKeys( string $prefix = string ): array;

Almacena datos en el adaptador

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

protected function doGet( string $key );
protected function phpApcuDec( mixed $key, int $step = int, mixed $success = null, int $ttl = int ): bool | int;

@todo Remove the below once we get traits

protected function phpApcuDelete( mixed $key ): bool | array;
protected function phpApcuExists( mixed $key ): bool | array;
protected function phpApcuFetch( mixed $key, mixed $success = null ): mixed;
protected function phpApcuInc( mixed $key, int $step = int, mixed $success = null, int $ttl = int ): bool | int;
protected function phpApcuIterator( string $pattern ): APCuIterator | bool;
protected function phpApcuStore( mixed $key, mixed $payload, int $ttl = int ): bool | array;

Class Phalcon\Storage\Adapter\Libmemcached

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, Exception, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Support\Exception   Extends AbstractAdapter

Adaptador Libmemcached

Propiedades

/**
 * @var string
 */
protected prefix = ph-memc-;

Métodos

public function __construct( SerializerFactory $factory, array $options = [] );

Constructor Libmemcached.

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Lee datos desde el adaptador

public function getAdapter(): mixed;

Devuelve el adaptador ya conectado o conecta al/los servidor/es de Memcached

public function getKeys( string $prefix = string ): array;

Almacena datos en el adaptador

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

Class Phalcon\Storage\Adapter\Memory

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, Exception, Phalcon\Storage\SerializerFactory, Phalcon\Support\Exception   Extends AbstractAdapter

Adaptador de Memoria

Propiedades

/**
 * @var array
 */
protected data;

Métodos

public function __construct( SerializerFactory $factory, array $options = [] );

Memory constructor.

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Borra datos desde el adaptador

public function getKeys( string $prefix = string ): array;

Almacena datos en el adaptador

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

protected function doGet( string $key );

Class Phalcon\Storage\Adapter\Redis

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, Exception, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Support\Exception   Extends AbstractAdapter

Adaptador Redis

Propiedades

/**
 * @var string
 */
protected prefix = ph-reds-;

Métodos

public function __construct( SerializerFactory $factory, array $options = [] );

Redis constructor.

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Lee datos desde el adaptador

public function getAdapter(): mixed;

Devuelve el adaptador ya conectado o conecta al/los servidor/es de Redis

public function getKeys( string $prefix = string ): array;

Almacena datos en el adaptador

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

Class Phalcon\Storage\Adapter\Stream

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, FilesystemIterator, Iterator, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Traits\StorageErrorHandlerTrait, Phalcon\Support\Exception, RecursiveDirectoryIterator, RecursiveIteratorIterator   Extends AbstractAdapter

Adaptador de Flujo

Propiedades

/**
 * @var string
 */
protected prefix = ph-strm;

/**
 * @var string
 */
protected storageDir = ;

Métodos

public function __construct( SerializerFactory $factory, array $options = [] );

Constructor Stream.

public function clear(): bool;

Vacía/Limpia la caché

public function decrement( string $key, int $value = int ): int | bool;

Decrementa el número almacenado

public function delete( string $key ): bool;

Lee datos desde el adaptador

public function get( string $key, mixed $defaultValue = null ): mixed;

Lee datos desde el adaptador

public function getKeys( string $prefix = string ): array;

Almacena datos en el adaptador

public function has( string $key ): bool;

Comprueba si un elemento existe en el caché y no ha expirado

public function increment( string $key, int $value = int ): int | bool;

Incrementa un número almacenado

public function set( string $key, mixed $value, mixed $ttl = null ): bool;

Almacena datos en el adaptador. If the TTL is null (default) or not defined then the default TTL will be used, as set in this adapter. If the TTL is 0 or a negative number, a delete() will be issued, since this item has expired. If you need to set this key forever, you should use the setForever() method.

public function setForever( string $key, mixed $value ): bool;

Stores data in the adapter forever. The key needs to manually deleted from the adapter.

protected function phpFileExists( string $filename ): bool;

@todo Remove the methods below when we get traits

protected function phpFileGetContents( string $filename ): string | bool;
protected function phpFilePutContents( string $filename, mixed $data, int $flags = int, mixed $context = null ): int | bool;
protected function phpFopen( string $filename, string $mode ): mixed;
protected function phpUnlink( string $filename ): bool;

Class Phalcon\Storage\AdapterFactory

Código fuente en GitHub

Namespace Phalcon\Storage   Uses Phalcon\Factory\AbstractFactory, Phalcon\Storage\Adapter\AdapterInterface   Extends AbstractFactory

Este fichero es parte del Framework Phalcon.

(c) Phalcon Team [email protected]

Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.

Propiedades

/**
 * @var SerializerFactory
 */
private serializerFactory;

Métodos

public function __construct( SerializerFactory $factory, array $services = [] );

Constructor AdapterFactory.

public function newInstance( string $name, array $options = [] ): AdapterInterface;

Crea una nueva instancia del adaptador

protected function getExceptionClass(): string;
protected function getServices(): array;

Devuelve los adaptadores disponibles

Class Phalcon\Storage\Exception

Código fuente en GitHub

Namespace Phalcon\Storage   Extends \Exception

Phalcon\Storage\Exception

Las excepciones lanzadas en Phalcon\Storage usarán esta clase

Abstract Class Phalcon\Storage\Serializer\AbstractSerializer

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Implements SerializerInterface

Propiedades

/**
 * @var mixed
 */
protected data;

/**
 * @var bool
 */
protected isSuccess = true;

Métodos

public function __construct( mixed $data = null );

AbstractSerializer constructor.

public function __serialize(): array;

Serialize data

public function __unserialize( array $data ): void;

Unserialize data

public function getData();
public function isSuccess(): bool;

Returns true if the serialize/unserialize operation was successful; false otherwise

public function setData( mixed $data ): void;
protected function isSerializable( mixed $data ): bool;

If this returns true, then the data is returned as is

Class Phalcon\Storage\Serializer\Base64

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses InvalidArgumentException   Extends AbstractSerializer

Métodos

public function serialize(): string;

Serializa los datos

public function unserialize( mixed $data ): void;

Deserializa los datos

protected function phpBase64Decode( string $input, bool $strict = bool );

Wrapper for base64_decode

Class Phalcon\Storage\Serializer\Igbinary

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends AbstractSerializer

Este fichero es parte del Framework Phalcon.

(c) Phalcon Team [email protected]

Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.

Métodos

public function serialize();

Serializa los datos

public function unserialize( mixed $data ): void;

Deserializa los datos

protected function doSerialize( mixed $value ): string | null;

Serialize

protected function doUnserialize( mixed $value );

Unserialize

protected function phpIgbinarySerialize( mixed $value ): string | null;

Wrapper for igbinary_serialize

Class Phalcon\Storage\Serializer\Json

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses InvalidArgumentException, JsonSerializable   Extends AbstractSerializer

Métodos

public function serialize();

Serializa los datos

public function unserialize( mixed $data ): void;

Deserializa los datos

Class Phalcon\Storage\Serializer\MemcachedIgbinary

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Memcached ‘igbinary’ serializer

Class Phalcon\Storage\Serializer\MemcachedJson

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Memcached ‘json’ serializer

Class Phalcon\Storage\Serializer\MemcachedPhp

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Memcached ‘php’ serializer

Class Phalcon\Storage\Serializer\Msgpack

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends Igbinary

Métodos

protected function doSerialize( mixed $value ): string;

Serializa los datos

protected function doUnserialize( mixed $value );

Class Phalcon\Storage\Serializer\None

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends AbstractSerializer

Este fichero es parte del Framework Phalcon.

(c) Phalcon Team [email protected]

Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.

Métodos

public function serialize(): mixed;

Serializa los datos

public function unserialize( mixed $data ): void;

Deserializa los datos

Class Phalcon\Storage\Serializer\Php

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses InvalidArgumentException   Extends AbstractSerializer

Este fichero es parte del Framework Phalcon.

(c) Phalcon Team [email protected]

Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.

Métodos

public function serialize(): string;

Serializa los datos

public function unserialize( mixed $data ): void;

Deserializa los datos

Class Phalcon\Storage\Serializer\RedisIgbinary

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Redis ‘igbinary’ serializer

Class Phalcon\Storage\Serializer\RedisJson

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Redis ‘json’ serializer

Class Phalcon\Storage\Serializer\RedisMsgpack

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Redis ‘msgpack’ serializer

Class Phalcon\Storage\Serializer\RedisNone

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Redis ‘none’ serializer

Class Phalcon\Storage\Serializer\RedisPhp

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends None

Serializer using the built-in Redis ‘php’ serializer

Interface Phalcon\Storage\Serializer\SerializerInterface

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses Serializable   Extends Serializable

Métodos

public function getData(): mixed;
public function setData( mixed $data ): void;

Class Phalcon\Storage\SerializerFactory

Código fuente en GitHub

Namespace Phalcon\Storage   Uses Phalcon\Factory\AbstractFactory, Phalcon\Storage\Serializer\SerializerInterface   Extends AbstractFactory

Este fichero es parte del Framework Phalcon.

(c) Phalcon Team [email protected]

Para obtener toda la información sobre derechos de autor y licencias, por favor vea el archivo LICENSE.txt que se distribuyó con este código fuente.

Métodos

public function __construct( array $services = [] );

Constructor SerializerFactory.

public function newInstance( string $name ): SerializerInterface;
protected function getExceptionClass(): string;
protected function getServices(): array;

Devuelve los adaptadores disponibles