Storage\Adapter\AbstractAdapter 
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalDateTimeExceptionPhalcon\Storage\SerializerFactoryPhalcon\Storage\Serializer\SerializerInterfacePhalcon\Exception
-
Extends
-
Implements
AdapterInterface
Properties
/**
* @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;Methods
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
Storage\Adapter\AdapterInterface 
-
Namespace
Phalcon\Storage\Adapter
-
Uses
Phalcon\Storage\Serializer\SerializerInterface
-
Extends
-
Implements
Interface for Phalcon\Logger adapters
Methods
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
Storage\Adapter\Apcu
-
Namespace
Phalcon\Storage\Adapter
-
Uses
APCUIteratorDateIntervalExceptionPhalcon\Storage\SerializerFactoryPhalcon\Exception
-
Extends
AbstractAdapter -
Implements
Apcu adapter
Properties
/**
* @var array
*/
protected $options;Methods
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
Storage\Adapter\Libmemcached
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Exception
-
Extends
AbstractAdapter -
Implements
Libmemcached adapter
Properties
/**
* @var array
*/
protected $options;Methods
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
Storage\Adapter\Memory
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\SerializerFactoryPhalcon\Exception
-
Extends
AbstractAdapter -
Implements
Memory adapter
Properties
/**
* @var Collection|CollectionInterface
*/
protected $data;
/**
* @var array
*/
protected $options;Methods
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
Storage\Adapter\Redis
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Exception
-
Extends
AbstractAdapter -
Implements
Redis adapter
Properties
/**
* @var array
*/
protected $options;Methods
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;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 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. If no ttl is given, the default value will be used (3600s at the moment).
Storage\Adapter\Stream
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalFilesystemIteratorIteratorPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Storage\Traits\StorageErrorHandlerTraitPhalcon\ExceptionRecursiveDirectoryIteratorRecursiveIteratorIterator
-
Extends
AbstractAdapter -
Implements
Stream adapter
Properties
/**
* @var string
*/
protected $storageDir = ;
/**
* @var array
*/
protected $options;Methods
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
Storage\AdapterFactory
-
Namespace
Phalcon\Storage
-
Uses
Phalcon\Factory\AbstractFactoryPhalcon\Storage\Adapter\AdapterInterface
-
Extends
AbstractFactory -
Implements
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.
Properties
/**
* @var SerializerFactory
*/
private serializerFactory;Methods
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;Storage\Exception
-
Namespace
Phalcon\Storage
-
Uses
-
Extends
\Exception -
Implements
Phalcon\Storage\Exception
Exceptions thrown in Phalcon\Storage will use this class
Storage\Serializer\AbstractSerializer 
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
-
Implements
SerializerInterface
@property mixed $data @property bool $isSuccess
Properties
/**
* @var mixed
*/
protected $data;Methods
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
Storage\Serializer\Base64
-
Namespace
Phalcon\Storage\Serializer
-
Uses
InvalidArgumentException
-
Extends
AbstractSerializer -
Implements
Methods
public function serialize(): string;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\Igbinary
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
AbstractSerializer -
Implements
Methods
public function serialize(): string;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\Json
-
Namespace
Phalcon\Storage\Serializer
-
Uses
InvalidArgumentExceptionJsonSerializablePhalcon\Helper\Json\DecodePhalcon\Helper\Json\Encode
-
Extends
AbstractSerializer -
Implements
Methods
public function serialize(): string;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\Msgpack
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
Igbinary -
Implements
Methods
public function serialize(): string | null;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\None
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
AbstractSerializer -
Implements
Methods
public function serialize(): string;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\Php
-
Namespace
Phalcon\Storage\Serializer
-
Uses
InvalidArgumentException
-
Extends
AbstractSerializer -
Implements
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.
Methods
public function serialize(): string;Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\SerializerInterface 
-
Namespace
Phalcon\Storage\Serializer
-
Uses
Serializable
-
Extends
Serializable -
Implements
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.
Methods
public function getData(): mixed;public function setData( mixed $data ): void;Storage\SerializerFactory
-
Namespace
Phalcon\Storage
-
Uses
Phalcon\Factory\AbstractFactoryPhalcon\Storage\Serializer\SerializerInterface
-
Extends
AbstractFactory -
Implements
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.
Methods
public function __construct( array $services = [] );SerializerFactory constructor.
public function newInstance( string $name ): SerializerInterface;protected function getAdapters(): array;