Secciones

Abstract Class Phalcon\Storage\Adapter\AbstractAdapter

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses DateInterval, DateTime, Phalcon\Helper\Arr, Phalcon\Helper\Str, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface   Implements AdapterInterface

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

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 string
 */
protected prefix = ;

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

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

Métodos

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

Sets parameters based on options

abstract public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

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

Deletes data from the adapter

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

Reads data from the adapter

abstract public function getAdapter(): mixed;

Returns the adapter - connects to the storage if not connected

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

Returns all the keys stored

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

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

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

Filters the keys array based on global and passed prefix

protected function getPrefixedKey( mixed $key ): string;

Returns the key requested, prefixed

protected function getSerializedData( mixed $content ): mixed;

Returns serialized data

protected function getTtl( mixed $ttl ): int;

Calculates the TTL for a cache item

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

Returns unserialized data

protected function initSerializer(): void;

Initializes the serializer

Interface Phalcon\Storage\Adapter\AdapterInterface

Código fuente en GitHub

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

Interface for Phalcon\Logger adapters

Métodos

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Deletes data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Returns the already connected adapter or connects to the backend server(s)

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

Returns all the keys stored

public function getPrefix(): string;

Returns the prefix for the keys

public function has( string $key ): bool;

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\Adapter\Apcu

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses APCuIterator, Phalcon\Helper\Arr, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface   Extends AbstractAdapter

Apcu adapter

Propiedades

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

Métodos

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

Constructor

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Reads data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Always returns null

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

Stores data in the adapter

public function has( string $key ): bool;

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\Adapter\Libmemcached

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses Phalcon\Helper\Arr, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface   Extends AbstractAdapter

Libmemcached adapter

Propiedades

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

Métodos

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

Libmemcached constructor.

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Reads data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Returns the already connected adapter or connects to the Memcached server(s)

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

Stores data in the adapter

public function has( string $key ): bool;

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\Adapter\Memory

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses Phalcon\Collection, Phalcon\Helper\Arr, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface   Extends AbstractAdapter

Memory adapter

Propiedades

/**
 * @var Collection
 */
protected data;

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

Métodos

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

Constructor

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Reads data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Always returns null

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

Stores data in the adapter

public function has( string $key ): bool;

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\Adapter\Redis

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses Phalcon\Helper\Arr, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface   Extends AbstractAdapter

Redis adapter

Propiedades

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

Métodos

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

Constructor

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Reads data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Returns the already connected adapter or connects to the Redis server(s)

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

Gets the keys from the adapter. Accepts an optional prefix which will filter the keys returned

public function has( string $key ): bool;

Checks if an element exists in the cache

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\Adapter\Stream

Código fuente en GitHub

Namespace Phalcon\Storage\Adapter   Uses FilesystemIterator, Iterator, Phalcon\Helper\Arr, Phalcon\Helper\Str, Phalcon\Storage\Exception, Phalcon\Storage\SerializerFactory, Phalcon\Storage\Serializer\SerializerInterface, RecursiveDirectoryIterator, RecursiveIteratorIterator   Extends AbstractAdapter

Stream adapter

Propiedades

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

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

Métodos

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

Stream constructor.

public function clear(): bool;

Flushes/clears the cache

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

Decrements a stored number

public function delete( string $key ): bool;

Reads data from the adapter

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

Reads data from the adapter

public function getAdapter(): mixed;

Always returns null

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

Stores data in the adapter

public function has( string $key ): bool;

Checks if an element exists in the cache and is not expired

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

Increments a stored number

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

Stores data in the adapter

Class Phalcon\Storage\AdapterFactory

Código fuente en GitHub

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

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Propiedades

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

Métodos

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

AdapterFactory constructor.

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

Create a new instance of the adapter

protected function getAdapters(): array;

Class Phalcon\Storage\Exception

Código fuente en GitHub

Namespace Phalcon\Storage   Extends \Phalcon\Exception

Phalcon\Storage\Exception

Exceptions thrown in Phalcon\Storage will use this class

Abstract Class Phalcon\Storage\Serializer\AbstractSerializer

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses Phalcon\Storage\Exception   Implements SerializerInterface

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Propiedades

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

Métodos

public function __construct( mixed $data = null );

Constructor

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

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

Class Phalcon\Storage\Serializer\Base64

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses InvalidArgumentException   Extends AbstractSerializer

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Class Phalcon\Storage\Serializer\Igbinary

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends AbstractSerializer

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Class Phalcon\Storage\Serializer\Json

Código fuente en GitHub

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

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Class Phalcon\Storage\Serializer\Msgpack

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Extends AbstractSerializer

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string | null;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Class Phalcon\Storage\Serializer\None

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses InvalidArgumentException   Extends AbstractSerializer

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Class Phalcon\Storage\Serializer\Php

Código fuente en GitHub

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

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

public function serialize(): string;

Serializes data

public function unserialize( mixed $data ): void;

Unserializes data

Interface Phalcon\Storage\Serializer\SerializerInterface

Código fuente en GitHub

Namespace Phalcon\Storage\Serializer   Uses Serializable   Extends Serializable

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

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

This file is part of the Phalcon Framework.

(c) Phalcon Team [email protected]

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

Métodos

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

SerializerFactory constructor.

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