return 'mysql';
}
- /**
- * @param string $server
- * @param string $user
- * @param string $password
- * @param string $dbName
- * @throws Exception|DBConnectionError
- * @return bool
- */
- public function open( $server, $user, $password, $dbName ) {
+ protected function open( $server, $user, $password, $dbName ) {
# Close/unset connection handle
$this->close();
$res = $res->result;
}
Wikimedia\suppressWarnings();
- $n = $this->mysqlNumRows( $res );
+ $n = $res ? $this->mysqlNumRows( $res ) : 0;
Wikimedia\restoreWarnings();
// Unfortunately, mysql_num_rows does not reset the last errno.
/**
* Returns the text of the error message from previous MySQL operation
*
- * @param resource $conn Raw connection
+ * @param resource|null $conn Raw connection
* @return string
*/
abstract protected function mysqlError( $conn = null );
/**
* List all tables on the database
*
- * @param string $prefix Only show tables with this prefix, e.g. mw_
+ * @param string|null $prefix Only show tables with this prefix, e.g. mw_
* @param string $fname Calling function name
* @return array
*/
/**
* Lists VIEWs in the database
*
- * @param string $prefix Only show VIEWs with this prefix, eg.
+ * @param string|null $prefix Only show VIEWs with this prefix, eg.
* unit_test_, or $wgDBprefix. Default: null, would return all views.
* @param string $fname Name of calling function
* @return array
* Differentiates between a TABLE and a VIEW.
*
* @param string $name Name of the TABLE/VIEW to test
- * @param string $prefix
+ * @param string|null $prefix
* @return bool
* @since 1.22
*/