The main "DB" class is simply a container class with some static methods for creating DB objects as well as some utility functions common to all parts of DB.
More...
|
| | apiVersion () |
| | Return the DB API version.
|
| |
| | assertExtension ($name) |
| | Load a PHP database extension if it is not loaded already.
|
| |
| | connect ($dsn, $options=false) |
| | Create a new DB object and connect to the specified database.
|
| |
| | factory ($type) |
| | Create a new DB object for the specified database type.
|
| |
| | isError ($value) |
| | Tell whether a result code from a DB method is an error.
|
| |
| | isWarning ($value) |
| | Tell whether a result code from a DB method is a warning.
|
| |
| | load () |
| | Retrieve the data saved to the cache.
|
| |
| | mtime () |
| | Retrieve the last modified time for the cache.
|
| |
|
| parseDSN ($dsn) |
| |
| | save ($data) |
| | Save data to the cache.
|
| |
| | touch () |
| | Set the last modified time to the current time.
|
| |
| | unlink () |
| | Remove the cache.
|
| |
|
|
string const | TYPE_FEED = 'spc' |
| | Feed cache type.
|
| |
|
string const | TYPE_IMAGE = 'spi' |
| | Image cache type.
|
| |
The main "DB" class is simply a container class with some static methods for creating DB objects as well as some utility functions common to all parts of DB.
Base class for database-based caches.
@subpackage Caching
- Deprecated
- since SimplePie 1.8.0, use implementation of "Psr::SimpleCache::CacheInterface" instead
◆ apiVersion()
Return the DB API version.
- Return values
-
| int | the DB API version number |
◆ assertExtension()
| DB::assertExtension |
( |
| $name | ) |
|
Load a PHP database extension if it is not loaded already.
- Parameters
-
| $name | the base name of the extension (without the .so or .dll suffix) |
- Return values
-
| bool | true if the extension was already or successfully loaded, false if it could not be loaded |
◆ connect()
| DB::connect |
( |
| $dsn, |
|
|
| $options = false ) |
Create a new DB object and connect to the specified database.
- Parameters
-
| $dsn | mixed "data source name", see the DB\parseDSN method for a description of the dsn format. Can also be specified as an array of the format returned by DB\parseDSN. |
| $options | mixed if boolean (or scalar), tells whether this connection should be persistent (for backends that support this). This parameter can also be an array of options, see DB_common::setOption for more information on connection options. |
- Return values
-
| object | a newly created DB connection object, or a DB error object on error |
- See also
- DB\parseDSN
-
DB\isError
◆ factory()
Create a new DB object for the specified database type.
- Parameters
-
| $type | string database type, for example "mysql" |
- Return values
-
| object | a newly created DB object, or a DB error code on error |
◆ isError()
Tell whether a result code from a DB method is an error.
- Parameters
-
- Return values
-
| bool | whether $value is an error |
◆ isWarning()
Tell whether a result code from a DB method is a warning.
Warnings differ from errors in that they are generated by DB, and are not fatal.
- Parameters
-
- Return values
-
| bool | whether $value is a warning |
◆ load()
◆ mtime()
◆ prepare_simplepie_object_for_cache()
| static DB::prepare_simplepie_object_for_cache |
( |
| $data | ) |
|
|
staticprotected |
Helper for database conversion.
Converts a given {
- See also
- SimplePie} object into data to be stored
- Parameters
-
| SimplePie::SimplePie | $data | |
- Return values
-
| array | First item is the serialized data for storage, second item is the unique ID for this item |
◆ save()
Save data to the cache.
- Parameters
-
| array | SimplePie::SimplePie | $data | Data to store in the cache. If passed a SimplePie object, only cache the $data property |
- Return values
-
Implemented in File, Memcache, Memcached, MySQL, and Redis.
◆ touch()
◆ unlink()
The documentation for this class was generated from the following files:
- lib/adodb/adodb-pear.inc.php
- lib/simplepie/src/Cache/DB.php