DEFAULT_LIFETIME
DEFAULT_LIFETIME
Default cache lifetime (1 hour)
An object to manage a simple cache
The cache is backed by a MySQL database, with data stored as key => data
pairs. All data stored is must be serializable.
__construct(\mysqli $sql = null, string $table = null, string $key = null, string $cache = null) : void
Create a a new SimpleCache
| \mysqli | $sql | (Optional) |
| string | $table | (Optional) Cache table name in database |
| string | $key | (Optional) Cache key field name in database |
| string | $cache | (Optional) Cache storage field name in database |
buildCache(string $table = null, string $key = null, string $cache = null) : boolean
Create cache table in database
| string | $table | (Optional) Cache table name |
| string | $key | (Optional) Cache key field name |
| string | $cache | (Optional) Cache storage field name |
Returns TRUE on success, FALSE on failure
sqlInitialized() : boolean
Test for database connection initialization
If the database connection is not initalized, attempt to do so.
DATABASE_NOT_INITIALIZED If the backing database connection cannot be initialized
Returns TRUE if database connection is ready