MediaWiki  REL1_24
FakeDatabaseMysqlBase Class Reference

Fake class around abstract class so we can call concrete methods. More...

Inheritance diagram for FakeDatabaseMysqlBase:
Collaboration diagram for FakeDatabaseMysqlBase:

List of all members.

Public Member Functions

 __construct ()
 affectedRows ()
 Get the number of rows affected by the last write query.
 getServerVersion ()
 A string describing the current software version, like from mysql_get_server_info().
 insertId ()
 Get the inserted value of an auto-increment row.
 lastErrno ()
 Get the last error number.

Protected Member Functions

 closeConnection ()
 Closes underlying database connection.
 doQuery ($sql)
 The DBMS-dependent part of query()
 mysqlConnect ($realServer)
 Open a connection to a MySQL server.
 mysqlDataSeek ($res, $row)
 Move internal result pointer.
 mysqlError ($conn=null)
 Returns the text of the error message from previous MySQL operation.
 mysqlFetchArray ($res)
 Fetch a result row as an associative and numeric array.
 mysqlFetchField ($res, $n)
 Get column information from a result.
 mysqlFetchObject ($res)
 Fetch a result row as an object.
 mysqlFieldName ($res, $n)
 Get the name of the specified field in a result.
 mysqlFieldType ($res, $n)
 Get the type of the specified field in a result.
 mysqlFreeResult ($res)
 Free result memory.
 mysqlNumFields ($res)
 Get number of fields in result.
 mysqlNumRows ($res)
 Get number of rows in result.
 mysqlPing ()
 Ping a server connection or reconnect if there is no connection.
 mysqlSetCharset ($charset)
 Set the character set of the MySQL link.

Detailed Description

Fake class around abstract class so we can call concrete methods.

Definition at line 32 of file DatabaseMysqlBaseTest.php.


Constructor & Destructor Documentation


Member Function Documentation

Get the number of rows affected by the last write query.

See also:
http://www.php.net/mysql_affected_rows
Returns:
int

Implements DatabaseType.

Definition at line 90 of file DatabaseMysqlBaseTest.php.

Closes underlying database connection.

Since:
1.20
Returns:
bool Whether connection was closed successfully

Reimplemented from DatabaseBase.

Definition at line 37 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::doQuery ( sql) [protected]

The DBMS-dependent part of query()

Parameters:
string$sqlSQL query.
Returns:
ResultWrapper|bool Result object to feed to fetchObject, fetchRow, ...; or false on failure

Reimplemented from DatabaseBase.

Definition at line 40 of file DatabaseMysqlBaseTest.php.

A string describing the current software version, like from mysql_get_server_info().

Returns:
string Version information from the database server.

Implements DatabaseType.

Definition at line 93 of file DatabaseMysqlBaseTest.php.

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();

Returns:
int

Implements DatabaseType.

Definition at line 84 of file DatabaseMysqlBaseTest.php.

Get the last error number.

See also:
http://www.php.net/mysql_errno
Returns:
int

Implements DatabaseType.

Definition at line 87 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlConnect ( realServer) [protected]

Open a connection to a MySQL server.

Parameters:
string$realServer
Returns:
mixed Raw connection
Exceptions:
DBConnectionError

Reimplemented from DatabaseMysqlBase.

Definition at line 44 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlDataSeek ( res,
row 
) [protected]

Move internal result pointer.

Parameters:
ResultWrapper | resource$res
int$row
Returns:
bool

Reimplemented from DatabaseMysqlBase.

Definition at line 71 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlError ( conn = null) [protected]

Returns the text of the error message from previous MySQL operation.

Parameters:
resource$connRaw connection
Returns:
string

Reimplemented from DatabaseMysqlBase.

Definition at line 74 of file DatabaseMysqlBaseTest.php.

Fetch a result row as an associative and numeric array.

Parameters:
resource$resRaw result
Returns:
array

Reimplemented from DatabaseMysqlBase.

Definition at line 56 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlFetchField ( res,
n 
) [protected]

Get column information from a result.

Parameters:
resource$resRaw result
int$n
Returns:
stdClass

Reimplemented from DatabaseMysqlBase.

Definition at line 77 of file DatabaseMysqlBaseTest.php.

Fetch a result row as an object.

Parameters:
resource$resRaw result
Returns:
stdClass

Reimplemented from DatabaseMysqlBase.

Definition at line 53 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlFieldName ( res,
n 
) [protected]

Get the name of the specified field in a result.

Parameters:
ResultWrapper | resource$res
int$n
Returns:
string

Reimplemented from DatabaseMysqlBase.

Definition at line 65 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlFieldType ( res,
n 
) [protected]

Get the type of the specified field in a result.

Parameters:
ResultWrapper | resource$res
int$n
Returns:
string

Reimplemented from DatabaseMysqlBase.

Definition at line 68 of file DatabaseMysqlBaseTest.php.

Free result memory.

Parameters:
resource$resRaw result
Returns:
bool

Reimplemented from DatabaseMysqlBase.

Definition at line 50 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlNumFields ( res) [protected]

Get number of fields in result.

Parameters:
resource$resRaw result
Returns:
int

Reimplemented from DatabaseMysqlBase.

Definition at line 62 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlNumRows ( res) [protected]

Get number of rows in result.

Parameters:
resource$resRaw result
Returns:
int

Reimplemented from DatabaseMysqlBase.

Definition at line 59 of file DatabaseMysqlBaseTest.php.

Ping a server connection or reconnect if there is no connection.

Returns:
bool

Reimplemented from DatabaseMysqlBase.

Definition at line 80 of file DatabaseMysqlBaseTest.php.

FakeDatabaseMysqlBase::mysqlSetCharset ( charset) [protected]

Set the character set of the MySQL link.

Parameters:
string$charset
Returns:
bool

Reimplemented from DatabaseMysqlBase.

Definition at line 47 of file DatabaseMysqlBaseTest.php.


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