Public Member Functions |
| Dataface_DB ($db=null) |
| _loadCache () |
| cache ($key, $value, $lang=null) |
& | _getParser () |
& | _getCompiler () |
| prepareQuery ($query) |
| _replacePrepareDigits ($matches) |
| _replaceCompileStrings ($matches) |
| _replaceCompileDigits ($matches) |
| _replaceBlobs ($matches) |
| compilePreparedQuery ($prepared_query) |
| translate_query ($query, $lang=null) |
| query ($sql, $db=null, $lang=null, $as_array=false, $enumerated=false) |
| insert_id () |
| writeCache () |
| registerBlob ($blobData) |
| checkoutBlob ($blobID) |
| startTransaction () |
| commitTransaction () |
| rollbackTransaction () |
| memcache_get ($sql, $lang=null) |
| memcache_mtime ($key, $set=false) |
| fcache_mtime ($key) |
| fcache_get ($key) |
| fcache_set ($key, $value) |
| fcache_path ($key) |
| memcache_get_key ($sql, $lang) |
| memcache_set ($sql, $lang, $value) |
| getTableDependencies ($sql, $lang=null) |
Static Public Member Functions |
static & | getInstance () |
Data Fields |
| $_db |
| $_fieldIndex = array() |
| $_queryCache = array() |
| $_parser = null |
| $_compiler = null |
| $_cache = null |
| $_cacheDirtyFlag = false |
| $app |
| $_matchCount |
| $_matches |
| $_insert_id |
| $count = 0 |
| $_fcache_base_path = null |
| $db_hits = 0 |
| $cache_hits = 0 |
| $cache_fails = 0 |
| $blobs = array() |
Detailed Description
Definition at line 34 of file DB.php.
Member Function Documentation
Obtains a reference to this object's SQL compiler.
Definition at line 134 of file DB.php.
Obtains reference to this class's SQL Parser.
Definition at line 122 of file DB.php.
Loads cached queries from the file Dataface_DB.cache in the DATAFACE_CACHE directory - usually Dataface/templates_c/__cache . This file will be a php file with an array by the name of "cache" defined.
Definition at line 86 of file DB.php.
_replaceBlobs |
( |
$ |
matches | ) |
|
_replaceCompileDigits |
( |
$ |
matches | ) |
|
_replaceCompileStrings |
( |
$ |
matches | ) |
|
_replacePrepareDigits |
( |
$ |
matches | ) |
|
cache |
( |
$ |
key, |
|
|
$ |
value, |
|
|
$ |
lang = null |
|
) |
| |
Adds a value to the cache.
Definition at line 109 of file DB.php.
compilePreparedQuery |
( |
$ |
prepared_query | ) |
|
fcache_set |
( |
$ |
key, |
|
|
$ |
value |
|
) |
| |
static& getInstance |
( |
| ) |
[static] |
getTableDependencies |
( |
$ |
sql, |
|
|
$ |
lang = null |
|
) |
| |
memcache_get |
( |
$ |
sql, |
|
|
$ |
lang = null |
|
) |
| |
memcache_get_key |
( |
$ |
sql, |
|
|
$ |
lang |
|
) |
| |
memcache_mtime |
( |
$ |
key, |
|
|
$ |
set = false |
|
) |
| |
Returns the modification time of the memcache entry for a particular key.
Definition at line 545 of file DB.php.
memcache_set |
( |
$ |
sql, |
|
|
$ |
lang, |
|
|
$ |
value |
|
) |
| |
Takes a select SQL query and separates the query portion from the data in the query. This will return an array where the first elemement is the generified SQL query sans any of the specified column values in the where clause and the remaining elements are the values that have been removed.
For example: Input = SELECT * FROM Players where FirstName = 'Bruce' Output = array( 'SELECT * FROM Players where FirstName = '{!#$S1%$#@!}', 'Bruce' );
Definition at line 152 of file DB.php.
query |
( |
$ |
sql, |
|
|
$ |
db = null , |
|
|
$ |
lang = null , |
|
|
$ |
as_array = false , |
|
|
$ |
enumerated = false |
|
) |
| |
Queries the database with the given sql query. This currently passes the query straight through to mysql_query, but it will be modified in the future to automatically filter out blobs (because normally we don't want to retrieve blob columns.
Definition at line 307 of file DB.php.
registerBlob |
( |
$ |
blobData | ) |
|
translate_query |
( |
$ |
query, |
|
|
$ |
lang = null |
|
) |
| |
Translates a select SQL query into a multilanguage query. It will compute the appropriate joins to the translation tables and swap the original column for its translated column in the join table.
- Parameters:
-
$query | The query. |
$lang | The 2 digit language code for the translation we wish to obtain. |
Definition at line 264 of file DB.php.
Writes the cache of SQL queries to a PHP file. This method is registered in DB constructor to automatically run on shutdown.
Definition at line 414 of file DB.php.
Field Documentation
$_fcache_base_path = null |
The documentation for this class was generated from the following file: