}
}
-class FakeDatabase extends DatabaseBase {
+class FakeDatabase extends Database {
public $lastInsertTable;
public $lastInsertData;
function __construct() {
+ $this->cliMode = true;
+ $this->connLogger = new \Psr\Log\NullLogger();
+ $this->queryLogger = new \Psr\Log\NullLogger();
+ $this->errorLogger = function ( Exception $e ) {
+ wfWarn( get_class( $e ) . ": {$e->getMessage()}" );
+ };
+ $this->currentDomain = DatabaseDomain::newUnspecified();
}
function clearFlag( $arg, $remember = self::REMEMBER_NOTHING ) {
* member variables.
* If no more rows are available, false is returned.
*
- * @param ResultWrapper|stdClass $res Object as returned from DatabaseBase::query(), etc.
+ * @param ResultWrapper|stdClass $res Object as returned from Database::query(), etc.
* @return stdClass|bool
* @throws DBUnexpectedError Thrown if the database returns an error
*/
* form. Fields are retrieved with $row['fieldname'].
* If no more rows are available, false is returned.
*
- * @param ResultWrapper $res Result object as returned from DatabaseBase::query(), etc.
+ * @param ResultWrapper $res Result object as returned from Database::query(), etc.
* @return array|bool
* @throws DBUnexpectedError Thrown if the database returns an error
*/
/**
* Get the number of fields in a result object
- * @see http://www.php.net/mysql_num_fields
+ * @see https://secure.php.net/mysql_num_fields
*
* @param mixed $res A SQL result
* @return int
/**
* Get a field name in a result object
- * @see http://www.php.net/mysql_field_name
+ * @see https://secure.php.net/mysql_field_name
*
* @param mixed $res A SQL result
* @param int $n
/**
* Change the position of the cursor in a result object
- * @see http://www.php.net/mysql_data_seek
+ * @see https://secure.php.net/mysql_data_seek
*
* @param mixed $res A SQL result
* @param int $row
/**
* Get the last error number
- * @see http://www.php.net/mysql_errno
+ * @see https://secure.php.net/mysql_errno
*
* @return int
*/
/**
* Get a description of the last error
- * @see http://www.php.net/mysql_error
+ * @see https://secure.php.net/mysql_error
*
* @return string
*/
/**
* Get the number of rows affected by the last write query
- * @see http://www.php.net/mysql_affected_rows
+ * @see https://secure.php.net/mysql_affected_rows
*
* @return int
*/
/**
* Returns a wikitext link to the DB's website, e.g.,
- * return "[http://www.mysql.com/ MySQL]";
+ * return "[https://www.mysql.com/ MySQL]";
* Should at least contain plain text, if for some reason
* your database has no website.
*