Merge "rdbms: Remove a cluster of unused and deprecated functions"
This commit is contained in:
commit
ead3e8d20f
8 changed files with 4 additions and 113 deletions
|
|
@ -282,6 +282,10 @@ because of Phabricator reports.
|
|||
- ::fieldName() soft-deprecated since 1.37
|
||||
- ::onTransactionIdle() soft-deprecated since 1.32
|
||||
- ::getMasterPos() since 1.37
|
||||
* DatabaseMysqlBase::fieldType() and DatabasePostgres::fieldType(), deprecated
|
||||
since 1.37, have been removed.
|
||||
* ResultWrapper::getInternalResult(), soft-deprecated since 1.37 and
|
||||
ResultWrapper::unwrap(), deprecated since 1.37, have been removed.
|
||||
* Language::AS_AUTONYMS, deprecated since 1.34, has been removed. You can use
|
||||
the LanguageNameUtils::AUTONYMS constant instead.
|
||||
* Several Language class variables deprecated in 1.35 have been removed; they
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
namespace Wikimedia\Rdbms;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use mysqli_result;
|
||||
use RuntimeException;
|
||||
use stdClass;
|
||||
use Wikimedia\AtEase\AtEase;
|
||||
|
|
@ -231,33 +230,6 @@ abstract class DatabaseMysqlBase extends Database {
|
|||
*/
|
||||
abstract protected function mysqlConnect( $server, $user, $password, $db );
|
||||
|
||||
/**
|
||||
* mysql_field_type() wrapper
|
||||
*
|
||||
* Not part of the interface and apparently not called by anything.
|
||||
*
|
||||
* @deprecated since 1.37
|
||||
*
|
||||
* @param MysqliResultWrapper $res
|
||||
* @param int $n
|
||||
* @return string
|
||||
*/
|
||||
public function fieldType( $res, $n ) {
|
||||
wfDeprecated( __METHOD__, '1.37' );
|
||||
return $this->mysqlFieldType( $res->getInternalResult(), $n );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the type of the specified field in a result
|
||||
*
|
||||
* @deprecated since 1.37
|
||||
*
|
||||
* @param mysqli_result $res
|
||||
* @param int $n
|
||||
* @return string
|
||||
*/
|
||||
abstract protected function mysqlFieldType( $res, $n );
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -165,17 +165,6 @@ class DatabaseMysqli extends DatabaseMysqlBase {
|
|||
return $conn->affected_rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mysqli_result $res
|
||||
* @param int $n
|
||||
* @return string
|
||||
*/
|
||||
protected function mysqlFieldType( $res, $n ) {
|
||||
$field = $res->fetch_field_direct( $n );
|
||||
|
||||
return $field->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mysqli|null $conn Optional connection object
|
||||
* @return string
|
||||
|
|
|
|||
|
|
@ -1137,20 +1137,6 @@ SQL;
|
|||
return PostgresField::fromText( $this, $table, $field );
|
||||
}
|
||||
|
||||
/**
|
||||
* pg_field_type() wrapper
|
||||
*
|
||||
* @deprecated since 1.37
|
||||
*
|
||||
* @param PostgresResultWrapper $res ResultWrapper or PostgreSQL query result resource
|
||||
* @param int $index Field number, starting from 0
|
||||
* @return string
|
||||
*/
|
||||
public function fieldType( $res, $index ) {
|
||||
wfDeprecated( __METHOD__, '1.37' );
|
||||
return pg_field_type( $res->getInternalResult(), $index );
|
||||
}
|
||||
|
||||
public function encodeBlob( $b ) {
|
||||
return new PostgresBlob( pg_escape_bytea( $b ) );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,17 +65,6 @@ class MysqliResultWrapper extends ResultWrapper {
|
|||
$this->result->data_seek( $pos );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying result object or array
|
||||
*
|
||||
* @since 1.37
|
||||
* @deprecated since 1.37 Only exists to support deprecated methods
|
||||
* @return mysqli_result
|
||||
*/
|
||||
public function getInternalResult() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
protected function doFree() {
|
||||
$this->result = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,17 +24,6 @@ class PostgresResultWrapper extends ResultWrapper {
|
|||
$this->result = $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying result object or array
|
||||
*
|
||||
* @since 1.37
|
||||
* @deprecated since 1.37 Only exists to support deprecated methods
|
||||
* @return resource
|
||||
*/
|
||||
public function getInternalResult() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
protected function doNumRows() {
|
||||
return pg_num_rows( $this->result );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,33 +44,6 @@ abstract class ResultWrapper implements IResultWrapper {
|
|||
*/
|
||||
private $fieldNames;
|
||||
|
||||
/**
|
||||
* Get the underlying RDBMS driver-specific result resource
|
||||
*
|
||||
* The result resource field should not be accessed from non-Database related classes.
|
||||
* It is database class specific and is stored here to associate iterators with queries.
|
||||
*
|
||||
* @since 1.34
|
||||
* @deprecated since 1.37
|
||||
*
|
||||
* @param self|mixed $res
|
||||
* @return mixed
|
||||
*/
|
||||
public static function unwrap( $res ) {
|
||||
wfDeprecated( __METHOD__, '1.37' );
|
||||
if ( $res instanceof MysqliResultWrapper ) {
|
||||
return $res->getInternalResult();
|
||||
} elseif ( $res instanceof SqliteResultWrapper ) {
|
||||
return $res->getInternalResult();
|
||||
} elseif ( $res instanceof PostgresResultWrapper ) {
|
||||
return $res->getInternalResult();
|
||||
} elseif ( $res instanceof IResultWrapper ) {
|
||||
throw new \InvalidArgumentException( __METHOD__ . ': $res does not support unwrap()' );
|
||||
} else {
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of rows in the result set
|
||||
*
|
||||
|
|
|
|||
|
|
@ -24,17 +24,6 @@ class SqliteResultWrapper extends ResultWrapper {
|
|||
$this->rows = $result->fetchAll( PDO::FETCH_OBJ );
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the underlying result object or array
|
||||
*
|
||||
* @since 1.37
|
||||
* @deprecated since 1.37 Only exists to support deprecated methods
|
||||
* @return PDOStatement
|
||||
*/
|
||||
public function getInternalResult() {
|
||||
return $this->result;
|
||||
}
|
||||
|
||||
protected function doNumRows() {
|
||||
return count( $this->rows );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue