MediaWiki  REL1_19
MockDatabaseSqlite Class Reference
Inheritance diagram for MockDatabaseSqlite:
Collaboration diagram for MockDatabaseSqlite:

List of all members.

Public Member Functions

 __construct ()
 query ($sql, $fname= '', $tempIgnore=false)
 Run an SQL query and return the result.
 replaceVars ($s)

Public Attributes

 $lastQuery

Detailed Description

Definition at line 3 of file DatabaseSqliteTest.php.


Constructor & Destructor Documentation

Definition at line 6 of file DatabaseSqliteTest.php.


Member Function Documentation

MockDatabaseSqlite::query ( sql,
fname = '',
tempIgnore = false 
)

Run an SQL query and return the result.

Normally throws a DBQueryError on failure. If errors are ignored, returns false instead.

In new code, the query wrappers select(), insert(), update(), delete(), etc. should be used where possible, since they give much better DBMS independence and automatically quote or validate user input in a variety of contexts. This function is generally only useful for queries which are explicitly DBMS-dependent and are unsupported by the query wrappers, such as CREATE TABLE.

However, the query wrappers themselves should call this function.

Parameters:
$sqlString: SQL query
$fnameString: Name of the calling function, for profiling/SHOW PROCESSLIST comment (you can use __METHOD__ or add some extra info)
$tempIgnoreBoolean: Whether to avoid throwing an exception on errors... maybe best to catch the exception instead?
Returns:
boolean|ResultWrapper. true for a successful write query, ResultWrapper object for a successful read query, or false on failure if $tempIgnore set
Exceptions:
DBQueryErrorThrown when the database returns an error of any kind

Reimplemented from DatabaseBase.

Definition at line 10 of file DatabaseSqliteTest.php.

References DatabaseBase\lastQuery().

Here is the call graph for this function:

Parameters:
$sstring
Returns:
string

Reimplemented from DatabaseSqlite.

Definition at line 15 of file DatabaseSqliteTest.php.


Member Data Documentation

MockDatabaseSqlite::$lastQuery

Definition at line 4 of file DatabaseSqliteTest.php.


The documentation for this class was generated from the following file: