Cache\Backend\Mongo

extends abstract class Phalcon\Cache\Backend implements Phalcon\Cache\BackendInterface Source on GitHub Allows to cache output fragments, PHP data or raw data to a MongoDb backend use Phalcon\Cache\Backend\Mongo; use Phalcon\Cache\Frontend\Base64; // Cache data for 2 days $frontCache = new Base64([ 'lifetime' => 172800 ]); // Create a MongoDB cache $cache = new Mongo($frontCache, [ 'server' => "mongodb://localhost", 'db' => 'caches', 'collection' => 'imag

Cache\Backend\Memory::queryKeys

public array queryKeys ([string | int $prefix]) Query the existing cached keys

Cache\Backend\Memory::serialize

public serialize () Required for interface \Serializable

Cache\Backend\Memory::flush

public flush () Immediately invalidates all existing items.

Cache\Backend\Memory::get

public get (mixed $keyName, [mixed $lifetime]) Returns a cached content

Cache\Backend\Memory::increment

public long increment ([string $keyName], [mixed $value]) Increment of given $keyName by $value

Cache\Backend\Memory::delete

public boolean delete (string $keyName) Deletes a value from the cache by its key

Cache\Backend\Memory::exists

public boolean exists ([string | int $keyName], [long $lifetime]) Checks if cache exists and it hasn’t expired

Cache\Backend\Memory::decrement

public long decrement ([string $keyName], [long $value]) Decrement of $keyName by given $value

Cache\Backend\Memcache::save

public save ([int | string $keyName], [string $content], [long $lifetime], [boolean $stopBuffer]) Stores cached content into the file backend and stops the frontend