Class ilance_database

Description

ILance database class to perform the majority of database caching in ILance

  • author: ILance
  • version: $Revision: 1.0.0 $

Located in /api/class.database.inc.php (line 27)


	
			
Direct descendents
Class Description
ilance_nocache ILance database class to perform the majority of database caching in ILance
ilance_filecache ILance file system cache class to perform the majority of database caching in ILance
ilance_apc ILance APC class to perform the majority of database caching in ILance
ilance_memcached ILance Memcached class to perform the majority of database memory caching in ILance
ilance_mssql MS-SQL database class to perform the majority of database related functions in ILance.
ilance_mysql MySQL database class to perform the majority of database related functions in ILance
ilance_mysqli MySQLi database class to perform the majority of database related functions in ILance.
Variable Summary
mixed $database
$debug $debug
mixed $end
mixed $errno
mixed $error
$email_reporting $error_reporting
mixed $explain
mixed $formatted
$multiserver $multiserver
mixed $querylist
mixed $query_count
$registry $registry
$start $start
mixed $totaltime
mixed $ttquery
Method Summary
ilance_database ilance_database ()
nothing add ()
boolean add_field_if_not_exist ([string $table = ''], [string $column = ''], [string $attributes = ''], [string $addaftercolumn = ''], [ $doquery = true])
boolean change_field_if_not_exist ([string $table = ''], [string $column = ''], [string $attributes = ''], [string $null = ''], [string $default = ''], [ $doquery = true])
boolean connect ()
nothing dberror ([ $string = ''])
nothing explain_query ([string $string = ''], [integer $qtime = ''], [string $script = ''], [string $line = ''])
boolean field_exists ([string $field = ''], [string $table = ''])
nothing format ([ $string = ''])
nothing gettime ()
void query_cache ( $sql,  $linkidentifier, [ $timeout = 60])
nothing remove ()
boolean select_db ([string $database = ''])
nothing stop ()
boolean table_exists ([string $table = ''])
nothing timer ()
Variables
mixed $connection_link = null (line 83)
mixed $connection_read = null (line 82)
mixed $connection_write = null (line 81)
mixed $database = null (line 77)
$debug $debug = false (line 41)

Debug Mode

mixed $email_reporting = true (line 49)
mixed $end = null (line 60)
mixed $errno = '' (line 85)
mixed $error = '' (line 84)
$email_reporting $error_reporting = true (line 48)

Email Error Reporting

mixed $explain = null (line 78)
mixed $formatted = null (line 62)
$multiserver $multiserver = false (line 76)

Database Connection Parameters

mixed $querylist = array() (line 79)
mixed $query_count = 0 (line 80)
$registry $registry = null (line 34)

The ILance registry object

$start $start = null (line 59)

Timer Variables

mixed $totaltime = null (line 61)
mixed $ttquery = 0 (line 87)
Methods
Constructor ilance_database (line 92)

Constructor

ilance_database ilance_database ()
add (line 497)

Timer add function

nothing add ()
add_field_if_not_exist (line 412)

Function to determine if a field within a table exists, and if not, to automatically add the necessary field column details

  • return: Returns valid sql string if added, blank string if already exists
boolean add_field_if_not_exist ([string $table = ''], [string $column = ''], [string $attributes = ''], [string $addaftercolumn = ''], [ $doquery = true])
  • string $table: database table name
  • string $column: table field name to add (if does not already exist)
  • string $attributes: table field attributes to process (ie: VARCHAR(250) NOT NULL)
  • string $addaftercolumn: table field name that we'll add our new field name after (ie: AFTER `title`)
  • $doquery
change_field_if_not_exist (line 454)

Function to determine if an existing field attribute needs to be changed preventing upgrades from any sql errors on duplicate attempts

  • return: Returns valid sql string if added, blank string if already exists
boolean change_field_if_not_exist ([string $table = ''], [string $column = ''], [string $attributes = ''], [string $null = ''], [string $default = ''], [ $doquery = true])
  • string $table: database table name
  • string $column: table field name to add (if does not already exist)
  • string $attributes: table field attributes to process (ie: VARCHAR(250) NOT NULL)
  • string $null: table field (ie: NOT NULL DEFAULT)
  • string $default: table field default (ie: 0000-00-00) if type was `date`
  • $doquery
connect (line 108)

Initialize database connection

Connects to a database server

boolean connect ()
dberror (line 259)

Function to perform database error handling

nothing dberror ([ $string = ''])
  • $string
explain_query (line 158)

Function to perform a database explain query

nothing explain_query ([string $string = ''], [integer $qtime = ''], [string $script = ''], [string $line = ''])
  • string $string: sql code
  • integer $qtime: sql query time
  • string $script: script name
  • string $line: script line number
field_exists (line 366)

Function to determine if a field within a table exists

  • return: Returns false on no field existing, true on field existing
boolean field_exists ([string $field = ''], [string $table = ''])
  • string $field: field name
  • string $table: table name
format (line 563)

Format time from timer() function

nothing format ([ $string = ''])
  • $string
gettime (line 511)

Get Time from timer() function

nothing gettime ()
query_cache (line 568)
void query_cache ( $sql,  $linkidentifier, [ $timeout = 60])
  • $sql
  • $linkidentifier
  • $timeout
remove (line 553)

Remove time from timer() function

nothing remove ()
select_db (line 128)

Selects a database for usage

boolean select_db ([string $database = ''])
  • string $database: name of the database to use
stop (line 535)

Stop time from timer() function

nothing stop ()
table_exists (line 389)

Function to determine if a database table exists based on the currently selected database

  • return: Returns false on no table existing, true on table existing
boolean table_exists ([string $table = ''])
  • string $table: table name
timer (line 487)

Timer function

nothing timer ()

Documentation generated on Mon, 08 Aug 2011 17:40:53 +0200 by phpDocumentor 1.4.1