Xataface 2.0
Xataface Application Framework
Public Member Functions | Static Public Member Functions | Data Fields
Dataface_DB Class Reference

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

& _getCompiler ( )

Obtains a reference to this object's SQL compiler.

Definition at line 134 of file DB.php.

& _getParser ( )

Obtains reference to this class's SQL Parser.

Definition at line 122 of file DB.php.

_loadCache ( )

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)

Definition at line 230 of file DB.php.

_replaceCompileDigits ( matches)

Definition at line 226 of file DB.php.

_replaceCompileStrings ( matches)

Definition at line 222 of file DB.php.

_replacePrepareDigits ( matches)

Definition at line 217 of file DB.php.

cache ( key,
value,
lang = null 
)

Adds a value to the cache.

Definition at line 109 of file DB.php.

checkoutBlob ( blobID)

Definition at line 460 of file DB.php.

commitTransaction ( )

Definition at line 469 of file DB.php.

compilePreparedQuery ( prepared_query)

Definition at line 240 of file DB.php.

Dataface_DB ( db = null)

Definition at line 54 of file DB.php.

fcache_get ( key)

Definition at line 575 of file DB.php.

fcache_mtime ( key)

Definition at line 565 of file DB.php.

fcache_path ( key)

Definition at line 588 of file DB.php.

fcache_set ( key,
value 
)

Definition at line 583 of file DB.php.

static& getInstance ( ) [static]

Definition at line 399 of file DB.php.

getTableDependencies ( sql,
lang = null 
)

Definition at line 626 of file DB.php.

insert_id ( )

Definition at line 394 of file DB.php.

memcache_get ( sql,
lang = null 
)

Definition at line 472 of file DB.php.

memcache_get_key ( sql,
lang 
)

Definition at line 592 of file DB.php.

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 
)

Definition at line 608 of file DB.php.

prepareQuery ( query)

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)

Definition at line 452 of file DB.php.

rollbackTransaction ( )

Definition at line 470 of file DB.php.

startTransaction ( )

Definition at line 468 of file DB.php.

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:
$queryThe query.
$langThe 2 digit language code for the translation we wish to obtain.

Definition at line 264 of file DB.php.

writeCache ( )

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

$_cache = null

Definition at line 40 of file DB.php.

$_cacheDirtyFlag = false

Definition at line 41 of file DB.php.

$_compiler = null

Definition at line 39 of file DB.php.

$_db

Definition at line 35 of file DB.php.

$_fcache_base_path = null

Definition at line 47 of file DB.php.

$_fieldIndex = array()

Definition at line 36 of file DB.php.

$_insert_id

Definition at line 45 of file DB.php.

$_matchCount

Definition at line 43 of file DB.php.

$_matches

Definition at line 44 of file DB.php.

$_parser = null

Definition at line 38 of file DB.php.

$_queryCache = array()

Definition at line 37 of file DB.php.

$app

Definition at line 42 of file DB.php.

$blobs = array()

Definition at line 52 of file DB.php.

$cache_fails = 0

Definition at line 50 of file DB.php.

$cache_hits = 0

Definition at line 49 of file DB.php.

$count = 0

Definition at line 46 of file DB.php.

$db_hits = 0

Definition at line 48 of file DB.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations