Public Member Functions | |
__construct ($server=false, $user=false, $password=false, $dbName=false, $failFunction=false, $flags=0, $tablePrefix= 'get from global') | |
Constructor. | |
open ($server, $user, $password, $dbName) | |
Usually aborts on failure If the failFunction is set to a non-zero integer, returns success. | |
doQuery ($sql) | |
The DBMS-dependent part of query(). | |
fetchObject ($res) | |
Fetch the next row from the given result object, in object form. | |
fetchRow ($res) | |
Fetch the next row from the given result object, in associative array form. | |
numRows ($res) | |
Get the number of rows in a result object. | |
numFields ($res) | |
Get the number of fields in a result object See documentation for mysql_num_fields(). | |
fieldName ($res, $n) | |
Get a field name in a result object See documentation for mysql_field_name(): http://www.php.net/mysql_field_name. | |
insertId () | |
Get the inserted value of an auto-increment row. | |
dataSeek ($res, $row) | |
Change the position of the cursor in a result object See mysql_data_seek(). | |
lastErrno () | |
Get the last error number See mysql_errno(). | |
lastError () | |
Get a description of the last error See mysql_error() for more details. | |
affectedRows () | |
Get the number of rows affected by the last write query See mysql_affected_rows() for more details. | |
fieldInfo ($table, $field) | |
mysql_fetch_field() wrapper Returns false if the field doesn't exist | |
strencode ($s) | |
Wrapper for addslashes(). | |
getSoftwareLink () | |
Returns a wikitext link to the DB's website, e.g., return "[http://www.mysql.com/ MySQL]"; Should at least contain plain text, if for some reason your database has no website. | |
getServerVersion () | |
A string describing the current software version, like from mysql_get_server_info(). | |
getType () | |
Get the type of the DBMS, as it appears in $wgDBtype. |
Definition at line 3 of file SearchUpdateTest.php.
DatabaseMock::__construct | ( | $ | server = false , |
|
$ | user = false , |
|||
$ | password = false , |
|||
$ | dbName = false , |
|||
$ | failFunction = false , |
|||
$ | flags = 0 , |
|||
$ | tablePrefix = 'get from global' | |||
) |
Constructor.
$server | String: database server host | |
$user | String: database user name | |
$password | String: database user password | |
$dbName | String: database name | |
$failFunction | ||
$flags | ||
$tablePrefix | String: database table prefixes. By default use the prefix gave in LocalSettings.php |
Reimplemented from DatabaseBase.
Definition at line 4 of file SearchUpdateTest.php.
DatabaseMock::affectedRows | ( | ) |
Get the number of rows affected by the last write query See mysql_affected_rows() for more details.
Reimplemented from DatabaseBase.
Definition at line 22 of file SearchUpdateTest.php.
DatabaseMock::dataSeek | ( | $ | res, | |
$ | row | |||
) |
Change the position of the cursor in a result object See mysql_data_seek().
$res | Mixed: A SQL result | |
$row | Mixed: Either MySQL row or ResultWrapper |
Reimplemented from DatabaseBase.
Definition at line 19 of file SearchUpdateTest.php.
DatabaseMock::doQuery | ( | $ | sql | ) |
The DBMS-dependent part of query().
$sql | String: SQL query. |
Reimplemented from DatabaseBase.
Definition at line 12 of file SearchUpdateTest.php.
DatabaseMock::fetchObject | ( | $ | res | ) |
Fetch the next row from the given result object, in object form.
Fields can be retrieved with $row->fieldname, with fields acting like member variables.
$res | SQL result object as returned from Database::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Reimplemented from DatabaseBase.
Definition at line 13 of file SearchUpdateTest.php.
DatabaseMock::fetchRow | ( | $ | res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname'].
$res | SQL result object as returned from Database::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Reimplemented from DatabaseBase.
Definition at line 14 of file SearchUpdateTest.php.
DatabaseMock::fieldInfo | ( | $ | table, | |
$ | field | |||
) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
$table | ||
$field |
Reimplemented from DatabaseBase.
Definition at line 23 of file SearchUpdateTest.php.
DatabaseMock::fieldName | ( | $ | res, | |
$ | n | |||
) |
Get a field name in a result object See documentation for mysql_field_name(): http://www.php.net/mysql_field_name.
$res | Mixed: A SQL result | |
$n | Integer |
Reimplemented from DatabaseBase.
Definition at line 17 of file SearchUpdateTest.php.
DatabaseMock::getServerVersion | ( | ) |
A string describing the current software version, like from mysql_get_server_info().
Will be listed on Special:Version, etc.
Reimplemented from DatabaseBase.
Definition at line 26 of file SearchUpdateTest.php.
DatabaseMock::getSoftwareLink | ( | ) |
Returns a wikitext link to the DB's website, e.g., return "[http://www.mysql.com/ MySQL]"; Should at least contain plain text, if for some reason your database has no website.
Reimplemented from DatabaseBase.
Definition at line 25 of file SearchUpdateTest.php.
DatabaseMock::getType | ( | ) |
Get the type of the DBMS, as it appears in $wgDBtype.
Reimplemented from DatabaseBase.
Definition at line 27 of file SearchUpdateTest.php.
DatabaseMock::insertId | ( | ) |
Get the inserted value of an auto-increment row.
The value inserted should be fetched from nextSequenceValue()
Example: $id = $dbw->nextSequenceValue('page_page_id_seq'); $dbw->insert('page',array('page_id' => $id)); $id = $dbw->insertId();
Reimplemented from DatabaseBase.
Definition at line 18 of file SearchUpdateTest.php.
DatabaseMock::lastErrno | ( | ) |
Get the last error number See mysql_errno().
Reimplemented from DatabaseBase.
Definition at line 20 of file SearchUpdateTest.php.
DatabaseMock::lastError | ( | ) |
Get a description of the last error See mysql_error() for more details.
Reimplemented from DatabaseBase.
Definition at line 21 of file SearchUpdateTest.php.
DatabaseMock::numFields | ( | $ | res | ) |
Get the number of fields in a result object See documentation for mysql_num_fields().
$res | Mixed: A SQL result |
Reimplemented from DatabaseBase.
Definition at line 16 of file SearchUpdateTest.php.
DatabaseMock::numRows | ( | $ | res | ) |
Get the number of rows in a result object.
$res | Mixed: A SQL result |
Reimplemented from DatabaseBase.
Definition at line 15 of file SearchUpdateTest.php.
DatabaseMock::open | ( | $ | server, | |
$ | user, | |||
$ | password, | |||
$ | dbName | |||
) |
Usually aborts on failure If the failFunction is set to a non-zero integer, returns success.
$server | String: database server host | |
$user | String: database user name | |
$password | String: database user password | |
$dbName | String: database name |
Reimplemented from DatabaseBase.
Definition at line 11 of file SearchUpdateTest.php.
DatabaseMock::strencode | ( | $ | s | ) |
Wrapper for addslashes().
$s | String: to be slashed. |
Reimplemented from DatabaseBase.
Definition at line 24 of file SearchUpdateTest.php.