Hazaar\Cache\Backend
Database
The database cache backend.

This is another reliable almost always available cache backend, similar to file. However if your database supports clustering/replication such as MySQL or PostgreSQL, then you have just given yourself a cheap reliable clustered cache backend.

This backend works by creating tables in the database server by default with a name of cache_{namespace}. You can of course override this but why would you want to? It works. Just make sure you have your databas environment configred and the user has create privileges.

NOTE: The configuration options are passed directly "as is" to the database backend. This allows the backend to override the default database settings when creating the DBI object. This allows you to have a completely separate database where the cache user has table create privileges in a database that is not where you keep all your important stuff.

Available config options:

  • cachetable - The name of the table to use for this instance of the cache backend. Default: cache{namespace}.
  • ...DBI options... - See the DBI documentation for options you can use to configure your DBI instance.
Summary
MethodsPropertiesConstants
No constants
Properties
$db
$db
$weight
$weight
Methods
Static
available()
available()
clear()
clear()
get()
get($key)
has()
has($key)
init()
init($namespace)
remove()
remove($key)
set()
set($key, $value, $timeout = null)
Powered by Scroly.io Generated: Friday, August 30th 2019 at 11:44am