Storage\Adapter\AbstractAdapter 
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalDateTimeExceptionPhalcon\Storage\SerializerFactoryPhalcon\Storage\Serializer\SerializerInterfacePhalcon\Support\Exception
-
Extends
-
Implements
AdapterInterface
Class AbstractAdapter
@package Phalcon\Storage\Adapter
@property mixed $adapter @property string $defaultSerializer @property int $lifetime @property array $options @property string $prefix @property SerializerInterface $serializer @property SerializerFactory $serializerFactory
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 array
*/
protected $options;
/**
* @var string
*/
protected $prefix = ph-memo-;
/**
* Serializer
*
* @var SerializerInterface|null
*/
protected $serializer;
/**
* Serializer Factory
*
* @var SerializerFactory
*/
protected $serializerFactory;Methods
protected function __construct( SerializerFactory $factory, array $options = [] );AbstractAdapter constructor.
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
public function get( string $key, mixed $defaultValue = null ): mixed;Reads data from the adapter
public function getAdapter(): mixed;Returns the adapter - connects to the storage if not connected
public function getDefaultSerializer(): string;Name of the default serializer class
abstract public function getKeys( string $prefix = string ): array;Returns all the keys stored
public function getPrefix(): string;Returns the prefix
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 $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;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
@throws SupportException
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. 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.
Storage\Adapter\Apcu
-
Namespace
Phalcon\Storage\Adapter
-
Uses
APCUIteratorDateIntervalExceptionPhalcon\Storage\SerializerFactoryPhalcon\Support\Exception
-
Extends
AbstractAdapter -
Implements
Apcu adapter
@property array $options
Properties
/**
* @var string
*/
protected $prefix = ph-apcu-;Methods
public function __construct( SerializerFactory $factory, array $options = [] );Apcu 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 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. 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;Storage\Adapter\Libmemcached
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Support\Exception
-
Extends
AbstractAdapter -
Implements
Libmemcached adapter
Properties
/**
* @var string
*/
protected $prefix = ph-memc-;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 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. 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.
Storage\Adapter\Memory
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\SerializerFactoryPhalcon\Support\Exception
-
Extends
AbstractAdapter -
Implements
Memory adapter
@property array $data @property array $options
Properties
/**
* @var array
*/
protected $data;Methods
public function __construct( SerializerFactory $factory, array $options = [] );Memory 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 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. 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 );Storage\Adapter\Redis
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Support\Exception
-
Extends
AbstractAdapter -
Implements
Redis adapter
@property array $options
Properties
/**
* @var string
*/
protected $prefix = ph-reds-;Methods
public function __construct( SerializerFactory $factory, array $options = [] );Redis 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 getAdapter(): mixed;Returns the already connected adapter or connects to the Redis 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. 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.
Storage\Adapter\Stream
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalFilesystemIteratorIteratorPhalcon\Storage\ExceptionPhalcon\Storage\SerializerFactoryPhalcon\Storage\Traits\StorageErrorHandlerTraitPhalcon\Support\ExceptionRecursiveDirectoryIteratorRecursiveIteratorIterator
-
Extends
AbstractAdapter -
Implements
Stream adapter
@property string $storageDir @property array $options
Properties
/**
* @var string
*/
protected $prefix = ph-strm;
/**
* @var string
*/
protected $storageDir = ;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 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. 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;Storage\Adapter\Weak
-
Namespace
Phalcon\Storage\Adapter
-
Uses
DateIntervalExceptionPhalcon\Storage\SerializerFactoryPhalcon\Storage\Serializer\SerializerInterfacePhalcon\Support\Exception
-
Extends
AbstractAdapter -
Implements
- Weak Adapter */
Properties
/**
*
*
* @var int|null
*/
protected $fetching;
/**
* @var array
*/
protected $weakList;
/**
* @var array
*/
protected $options;Methods
public function __construct( SerializerFactory $factory, array $options = [] );Constructor, there are no options
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 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. 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 setDefaultSerializer( string $serializer ): void;will never set a serializer, WeakReference cannot be serialized
public function setForever( string $key, mixed $value ): bool;For compatiblity only, there is no Forever with WeakReference.
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 getExceptionClass(): string;protected function getServices(): array;Returns the available adapters
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;
/**
* @var bool
*/
protected $isSuccess = true;Methods
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
Storage\Serializer\Base64
-
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
protected function phpBase64Decode( string $input, bool $strict = bool );Wrapper for base64_decode
Storage\Serializer\Igbinary
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
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();Serializes data
public function unserialize( mixed $data ): void;Unserializes data
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
Storage\Serializer\Json
-
Namespace
Phalcon\Storage\Serializer
-
Uses
InvalidArgumentExceptionJsonSerializablePhalcon\Support\Helper\Json\DecodePhalcon\Support\Helper\Json\Encode
-
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.
Properties
/**
* @var Decode
*/
private $decode;
/**
* @var Encode
*/
private $encode;Methods
public function __construct( mixed $data = null );AbstractSerializer constructor.
public function serialize();Serializes data
public function unserialize( mixed $data ): void;Unserializes data
Storage\Serializer\MemcachedIgbinary
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Memcached ‘igbinary’ serializer
Storage\Serializer\MemcachedJson
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Memcached ‘json’ serializer
Storage\Serializer\MemcachedPhp
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Memcached ‘php’ serializer
Storage\Serializer\Msgpack
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
Igbinary -
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
protected function doSerialize( mixed $value ): string;Serializes data
protected function doUnserialize( mixed $value );Storage\Serializer\None
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
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(): mixed;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\RedisIgbinary
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Redis ‘igbinary’ serializer
Storage\Serializer\RedisJson
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Redis ‘json’ serializer
Storage\Serializer\RedisMsgpack
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Redis ‘msgpack’ serializer
Storage\Serializer\RedisNone
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Redis ‘none’ serializer
Storage\Serializer\RedisPhp
-
Namespace
Phalcon\Storage\Serializer
-
Uses
-
Extends
None -
Implements
Serializer using the built-in Redis ‘php’ serializer
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 getExceptionClass(): string;protected function getServices(): array;Returns the available adapters