MediaWiki
1.23.0
|
Public Member Functions | |
affectedRows () | |
Get the number of rows affected by the last write query. More... | |
dataSeek ( $res, $row) | |
Change the position of the cursor in a result object. More... | |
fetchObject ( $res) | |
Fetch the next row from the given result object, in object form. More... | |
fetchRow ( $res) | |
Fetch the next row from the given result object, in associative array form. More... | |
fieldInfo ( $table, $field) | |
mysql_fetch_field() wrapper Returns false if the field doesn't exist More... | |
fieldName ( $res, $n) | |
Get a field name in a result object. More... | |
getServerInfo () | |
A string describing the current software version, and possibly other details in a user-friendly way. More... | |
getServerVersion () | |
A string describing the current software version, like from mysql_get_server_info(). More... | |
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. More... | |
getType () | |
Get the type of the DBMS, as it appears in $wgDBtype. More... | |
indexInfo ( $table, $index, $fname=__METHOD__) | |
Get information about an index into an object. More... | |
insertId () | |
Get the inserted value of an auto-increment row. More... | |
lastErrno () | |
Get the last error number. More... | |
lastError () | |
Get a description of the last error. More... | |
numFields ( $res) | |
Get the number of fields in a result object. More... | |
numRows ( $res) | |
Get the number of rows in a result object. More... | |
open ( $server, $user, $password, $dbName) | |
Open a connection to the database. More... | |
strencode ( $s) | |
Wrapper for addslashes() More... | |
Definition at line 35 of file Database.php.
DatabaseType::affectedRows | ( | ) |
Get the number of rows affected by the last write query.
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, DatabaseMysqli, DatabaseTestHelper, DatabaseMysql, and FakeDatabaseMysqlBase.
DatabaseType::dataSeek | ( | $res, | |
$row | |||
) |
Change the position of the cursor in a result object.
mixed | $res | A SQL result |
int | $row |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysqlBase, DatabaseMssql, and DatabaseTestHelper.
DatabaseType::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. If no more rows are available, false is returned.
ResultWrapper | stdClass | $res | Object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, DatabaseMysqlBase, and DatabaseTestHelper.
Referenced by DatabaseBase\selectRow(), and DatabaseBase\textFieldSize().
DatabaseType::fetchRow | ( | $res | ) |
Fetch the next row from the given result object, in associative array form.
Fields are retrieved with $row['fieldname']. If no more rows are available, false is returned.
ResultWrapper | $res | Result object as returned from DatabaseBase::query(), etc. |
DBUnexpectedError | Thrown if the database returns an error |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, DatabaseMysqlBase, and DatabaseTestHelper.
Referenced by DatabaseBase\estimateRowCount(), and DatabaseBase\selectField().
DatabaseType::fieldInfo | ( | $table, | |
$field | |||
) |
mysql_fetch_field() wrapper Returns false if the field doesn't exist
string | $table | Table name |
string | $field | Field name |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseSqlite, DatabaseMysqlBase, and DatabaseTestHelper.
Referenced by DatabaseBase\fieldExists().
DatabaseType::fieldName | ( | $res, | |
$n | |||
) |
Get a field name in a result object.
mixed | $res | A SQL result |
int | $n |
Implemented in DatabaseOracle, DatabasePostgres, DatabaseSqlite, DatabaseMysqlBase, DatabaseMssql, and DatabaseTestHelper.
DatabaseType::getServerInfo | ( | ) |
A string describing the current software version, and possibly other details in a user-friendly way.
Will be listed on Special:Version, etc. Use getServerVersion() to get machine-friendly information.
Implemented in DatabaseSqlite, DatabaseBase, and DatabaseTestHelper.
DatabaseType::getServerVersion | ( | ) |
A string describing the current software version, like from mysql_get_server_info().
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseSqlite, DatabaseMysqli, DatabaseTestHelper, DatabaseMysql, and FakeDatabaseMysqlBase.
Referenced by DatabaseBase\getServerInfo(), and DatabaseMysqlBase\getSoftwareLink().
DatabaseType::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.
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseMysqlBase, DatabaseSqlite, and DatabaseTestHelper.
DatabaseType::getType | ( | ) |
Get the type of the DBMS, as it appears in $wgDBtype.
Implemented in DatabaseMssql, DatabasePostgres, DatabaseOracle, DatabaseTestHelper, DatabaseSqlite, and DatabaseMysqlBase.
Referenced by DatabaseBase\getSchemaPath(), MediaWikiTestCase\listTables(), DatabaseUpdater\newForDB(), DatabaseBase\patchPath(), and MediaWikiTestCase\setupTestDB().
DatabaseType::indexInfo | ( | $table, | |
$index, | |||
$fname = __METHOD__ |
|||
) |
Get information about an index into an object.
string | $table | Table name |
string | $index | Index name |
string | $fname | Calling function name |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseMysqlBase, DatabaseSqlite, and DatabaseTestHelper.
Referenced by DatabaseBase\indexExists(), and DatabaseBase\indexUnique().
DatabaseType::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();
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, DatabaseMysqli, DatabaseTestHelper, DatabaseMysql, and FakeDatabaseMysqlBase.
DatabaseType::lastErrno | ( | ) |
Get the last error number.
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMssql, DatabaseMysqli, DatabaseTestHelper, DatabaseMysql, and FakeDatabaseMysqlBase.
Referenced by DatabaseBase\deadlockLoop(), DatabaseMysqlBase\fetchObject(), DatabaseMysqlBase\fetchRow(), DatabaseBase\query(), DatabaseMysqlBase\wasDeadlock(), DatabaseMysqlBase\wasErrorReissuable(), DatabaseMysqlBase\wasLockTimeout(), and DatabaseMysqlBase\wasReadOnlyError().
DatabaseType::lastError | ( | ) |
Get a description of the last error.
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysqlBase, DatabaseMssql, and DatabaseTestHelper.
Referenced by MediaWikiTestCase\assertSelect(), DatabaseBase\deadlockLoop(), DatabaseBase\query(), DatabaseBase\reportConnectionError(), and DatabaseBase\sourceStream().
DatabaseType::numFields | ( | $res | ) |
Get the number of fields in a result object.
mixed | $res | A SQL result |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysqlBase, DatabaseMssql, and DatabaseTestHelper.
DatabaseType::numRows | ( | $res | ) |
Get the number of rows in a result object.
mixed | $res | A SQL result |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseSqlite, DatabaseMysqlBase, DatabaseMssql, and DatabaseTestHelper.
Referenced by DatabaseBase\selectField(), and DatabaseBase\selectRow().
DatabaseType::open | ( | $server, | |
$user, | |||
$password, | |||
$dbName | |||
) |
Open a connection to the database.
Usually aborts on failure
string | $server | database server host |
string | $user | database user name |
string | $password | database user password |
string | $dbName | database name |
DBConnectionError |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseTestHelper, DatabaseMssql, DatabaseMysqlBase, and DatabaseSqlite.
Referenced by DatabaseBase\__construct().
DatabaseType::strencode | ( | $s | ) |
Wrapper for addslashes()
string | $s | String to be slashed. |
Implemented in DatabasePostgres, DatabaseOracle, DatabaseMssql, DatabaseSqlite, DatabaseMysqlBase, and DatabaseTestHelper.
Referenced by DatabaseBase\addQuotes(), DatabaseBase\escapeLikeInternal(), and DatabaseBase\replaceSchemaVars().