Moodle  2.2.1
http://www.collinsharper.com
sqlite3_pdo_moodle_database Class Reference
Inheritance diagram for sqlite3_pdo_moodle_database:
Collaboration diagram for sqlite3_pdo_moodle_database:

Public Member Functions

 driver_installed ()
 get_dbfamily ()
 create_database ($dbhost, $dbuser, $dbpass, $dbname, array $dboptions=null)
 get_dbfilepath ()
 get_tables ($usecache=true)
 get_indexes ($table)
 get_columns ($table, $usecache=true)
 delete_records ($table, array $conditions=null)
 sql_concat ()
 sql_concat_join ($separator="' '", $elements=array())
 sql_bitxor ($int1, $int2)

Protected Member Functions

 get_dbtype ()
 configure_dbconnection ()
 get_dsn ()
 normalise_value ($column, $value)
 get_limit_clauses ($sql, $limitfrom=0, $limitnum=0)

Protected Attributes

 $database_file_extension = '.sq3.php'

Detailed Description

Experimental pdo database class

Definition at line 35 of file sqlite3_pdo_moodle_database.php.


Member Function Documentation

configure_dbconnection ( ) [protected]

Reimplemented from pdo_moodle_database.

Definition at line 67 of file sqlite3_pdo_moodle_database.php.

create_database ( dbhost,
dbuser,
dbpass,
dbname,
array dboptions = null 
)

Attempt to create the database

Parameters:
string$dbhost
string$dbuser
string$dbpass
string$dbname
Returns:
bool success

Reimplemented from moodle_database.

Definition at line 88 of file sqlite3_pdo_moodle_database.php.

Here is the call graph for this function:

delete_records ( table,
array conditions = null 
)

Delete the records from a table where all the given conditions met. If conditions not specified, table is truncated.

Parameters:
string$tablethe table to delete from.
array$conditionsoptional array $fieldname=>requestedvalue with AND in between
Returns:
returns success.

Reimplemented from moodle_database.

Definition at line 334 of file sqlite3_pdo_moodle_database.php.

Detects if all needed PHP stuff installed. Note: can be used before connect()

Returns:
mixed true if ok, string if something

Reimplemented from moodle_database.

Definition at line 42 of file sqlite3_pdo_moodle_database.php.

get_columns ( table,
usecache = true 
)

Returns detailed information about columns in table. This information is cached internally.

Parameters:
string$tablename
bool$usecache
Returns:
array array of database_column_info objects indexed with column names

Reimplemented from moodle_database.

Definition at line 193 of file sqlite3_pdo_moodle_database.php.

Here is the call graph for this function:

Returns database family type - describes SQL dialect Note: can be used before connect()

Returns:
string db family name (mysql, postgres, mssql, oracle, etc.)

Reimplemented from moodle_database.

Definition at line 54 of file sqlite3_pdo_moodle_database.php.

Returns the file path for the database file, computed from dbname and/or dboptions. If dboptions['file'] is set, then it is used (use :memory: for in memory database); else if dboptions['path'] is set, then the file will be <dboptions path>="">/<dbname>.sq3.php; else if dbhost is set and not localhost, then the file will be <dbhost>/<dbname>.sq3.php; else the file will be <moodle data="" path>="">/<dbname>.sq3.php

Returns:
string file path to the SQLite database;

Definition at line 116 of file sqlite3_pdo_moodle_database.php.

Here is the caller graph for this function:

get_dbtype ( ) [protected]

Returns more specific database driver type Note: can be used before connect()

Returns:
string db type mysqli, pgsql, oci, mssql, sqlsrv

Reimplemented from moodle_database.

Definition at line 63 of file sqlite3_pdo_moodle_database.php.

get_dsn ( ) [protected]

Returns the driver-dependent DSN for PDO based on members stored by connect. Must be called after connect (or after $dbname, $dbhost, etc. members have been set).

Returns:
string driver-dependent DSN

Reimplemented from pdo_moodle_database.

Definition at line 104 of file sqlite3_pdo_moodle_database.php.

get_indexes ( table)

Return table indexes - everything lowercased

Returns:
array of arrays

Reimplemented from moodle_database.

Definition at line 161 of file sqlite3_pdo_moodle_database.php.

Here is the call graph for this function:

get_limit_clauses ( sql,
limitfrom = 0,
limitnum = 0 
) [protected]

Returns the sql statement with clauses to append used to limit a recordset range.

Parameters:
string$sqlthe SQL statement to limit.
int$limitfromreturn a subset of records, starting at this point (optional, required if $limitnum is set).
int$limitnumreturn a subset comprising this many records (optional, required if $limitfrom is set).
Returns:
string the SQL statement with limiting clauses

Definition at line 316 of file sqlite3_pdo_moodle_database.php.

get_tables ( usecache = true)

Return tables in database WITHOUT current prefix

Returns:
array of table names in lowercase and without prefix

Reimplemented from moodle_database.

Definition at line 138 of file sqlite3_pdo_moodle_database.php.

Here is the call graph for this function:

normalise_value ( column,
value 
) [protected]

Normalise values based in RDBMS dependencies (booleans, LOBs...)

Parameters:
database_column_info$columncolumn metadata corresponding with the value we are going to normalise
mixed$valuevalue we are going to normalise
Returns:
mixed the normalised value

Reimplemented from moodle_database.

Definition at line 305 of file sqlite3_pdo_moodle_database.php.

sql_bitxor ( int1,
int2 
)

Returns the SQL text to be used in order to perform one bitwise XOR operation between 2 integers.

Parameters:
integerint1 first integer in the operation
integerint2 second integer in the operation
Returns:
string the piece of SQL code to be used in your statement.

Reimplemented from moodle_database.

Definition at line 381 of file sqlite3_pdo_moodle_database.php.

Returns the proper SQL to do CONCAT between the elements passed Can take many parameters

Parameters:
string$element
Returns:
string

Reimplemented from pdo_moodle_database.

Definition at line 349 of file sqlite3_pdo_moodle_database.php.

sql_concat_join ( separator = "' '",
elements = array() 
)

Returns the proper SQL to do CONCAT between the elements passed with a given separator

Parameters:
string$separator
array$elements
Returns:
string

Reimplemented from pdo_moodle_database.

Definition at line 362 of file sqlite3_pdo_moodle_database.php.


Field Documentation

$database_file_extension = '.sq3.php' [protected]

Definition at line 36 of file sqlite3_pdo_moodle_database.php.


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