[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cleanup method visibilites in Database
jenkins-bot has submitted this change and it was merged. Change subject: Cleanup method visibilites in Database .. Cleanup method visibilites in Database Also removed some unused cruft Change-Id: I855d0e0d6571ea15c03d2a27bf55ad5e14cd15d4 --- M includes/libs/rdbms/database/DBConnRef.php M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/database/IDatabase.php 3 files changed, 47 insertions(+), 48 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/rdbms/database/DBConnRef.php b/includes/libs/rdbms/database/DBConnRef.php index 2375678..1cb8906 100644 --- a/includes/libs/rdbms/database/DBConnRef.php +++ b/includes/libs/rdbms/database/DBConnRef.php @@ -316,6 +316,10 @@ return $this->__call( __FUNCTION__, func_get_args() ); } + public function aggregateValue( $valuedata, $valuename = 'value' ) { + return $this->__call( __FUNCTION__, func_get_args() ); + } + public function bitNot( $field ) { return $this->__call( __FUNCTION__, func_get_args() ); } @@ -338,6 +342,10 @@ return $this->__call( __FUNCTION__, func_get_args() ); } + public function buildStringCast( $field ) { + return $this->__call( __FUNCTION__, func_get_args() ); + } + public function selectDB( $db ) { return $this->__call( __FUNCTION__, func_get_args() ); } diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 7e80221..66412db 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -210,12 +210,6 @@ private $lazyMasterHandle; /** -* @since 1.21 -* @var resource File handle for upgrade -*/ - protected $fileHandle = null; - - /** * @since 1.22 * @var string[] Process cache of VIEWs names in the database */ @@ -470,15 +464,6 @@ return $old; } - /** -* Set the filehandle to copy write statements to. -* -* @param resource $fh File handle -*/ - public function setFileHandle( $fh ) { - $this->fileHandle = $fh; - } - public function getLBInfo( $name = null ) { if ( is_null( $name ) ) { return $this->mLBInfo; @@ -654,7 +639,7 @@ protected function installErrorHandler() { $this->mPHPError = false; $this->htmlErrors = ini_set( 'html_errors', '0' ); - set_error_handler( [ $this, 'connectionerrorLogger' ] ); + set_error_handler( [ $this, 'connectionErrorLogger' ] ); } /** @@ -676,10 +661,12 @@ } /** +* This method should not be used outside of Database classes +* * @param int $errno * @param string $errstr */ - public function connectionerrorLogger( $errno, $errstr ) { + public function connectionErrorLogger( $errno, $errstr ) { $this->mPHPError = $errstr; } @@ -736,7 +723,7 @@ */ abstract protected function closeConnection(); - function reportConnectionError( $error = 'Unknown error' ) { + public function reportConnectionError( $error = 'Unknown error' ) { $myError = $this->lastError(); if ( $myError ) { $error = $myError; @@ -1112,7 +1099,7 @@ * @return array * @see DatabaseBase::select() */ - public function makeSelectOptions( $options ) { + protected function makeSelectOptions( $options ) { $preLimitTail = $postLimitTail = ''; $startOpts = ''; @@ -1201,7 +1188,7 @@ * @see DatabaseBase::select() * @since 1.21 */ - public function makeGroupByWithHaving( $options ) { + protected function makeGroupByWithHaving( $options ) { $sql = ''; if ( isset( $options['GROUP BY'] ) ) { $gb = is_array( $options['GROUP BY'] ) @@ -1227,7 +1214,7 @@ * @see DatabaseBase::select() * @since 1.21 */ - public function makeOrderBy( $options ) { + protected function makeOrderBy( $options ) { if ( isset( $options['ORDER BY'] ) ) { $ob = is_array( $options['ORDER BY'] ) ? implode( ',', $options['ORDER BY'] ) @@ -1512,7 +1499,7 @@ return implode( ' ', $opts ); } - function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) { + public function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) { $table = $this->tableName(
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Cleanup method visibilites in Database
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/312080 Change subject: Cleanup method visibilites in Database .. Cleanup method visibilites in Database Also removed some unused cruft Change-Id: I855d0e0d6571ea15c03d2a27bf55ad5e14cd15d4 --- M includes/libs/rdbms/database/DBConnRef.php M includes/libs/rdbms/database/Database.php M includes/libs/rdbms/database/IDatabase.php 3 files changed, 47 insertions(+), 48 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/80/312080/1 diff --git a/includes/libs/rdbms/database/DBConnRef.php b/includes/libs/rdbms/database/DBConnRef.php index 2375678..1cb8906 100644 --- a/includes/libs/rdbms/database/DBConnRef.php +++ b/includes/libs/rdbms/database/DBConnRef.php @@ -316,6 +316,10 @@ return $this->__call( __FUNCTION__, func_get_args() ); } + public function aggregateValue( $valuedata, $valuename = 'value' ) { + return $this->__call( __FUNCTION__, func_get_args() ); + } + public function bitNot( $field ) { return $this->__call( __FUNCTION__, func_get_args() ); } @@ -338,6 +342,10 @@ return $this->__call( __FUNCTION__, func_get_args() ); } + public function buildStringCast( $field ) { + return $this->__call( __FUNCTION__, func_get_args() ); + } + public function selectDB( $db ) { return $this->__call( __FUNCTION__, func_get_args() ); } diff --git a/includes/libs/rdbms/database/Database.php b/includes/libs/rdbms/database/Database.php index 7e80221..66412db 100644 --- a/includes/libs/rdbms/database/Database.php +++ b/includes/libs/rdbms/database/Database.php @@ -210,12 +210,6 @@ private $lazyMasterHandle; /** -* @since 1.21 -* @var resource File handle for upgrade -*/ - protected $fileHandle = null; - - /** * @since 1.22 * @var string[] Process cache of VIEWs names in the database */ @@ -470,15 +464,6 @@ return $old; } - /** -* Set the filehandle to copy write statements to. -* -* @param resource $fh File handle -*/ - public function setFileHandle( $fh ) { - $this->fileHandle = $fh; - } - public function getLBInfo( $name = null ) { if ( is_null( $name ) ) { return $this->mLBInfo; @@ -654,7 +639,7 @@ protected function installErrorHandler() { $this->mPHPError = false; $this->htmlErrors = ini_set( 'html_errors', '0' ); - set_error_handler( [ $this, 'connectionerrorLogger' ] ); + set_error_handler( [ $this, 'connectionErrorLogger' ] ); } /** @@ -676,10 +661,12 @@ } /** +* This method should not be used outside of Database classes +* * @param int $errno * @param string $errstr */ - public function connectionerrorLogger( $errno, $errstr ) { + public function connectionErrorLogger( $errno, $errstr ) { $this->mPHPError = $errstr; } @@ -736,7 +723,7 @@ */ abstract protected function closeConnection(); - function reportConnectionError( $error = 'Unknown error' ) { + public function reportConnectionError( $error = 'Unknown error' ) { $myError = $this->lastError(); if ( $myError ) { $error = $myError; @@ -1112,7 +1099,7 @@ * @return array * @see DatabaseBase::select() */ - public function makeSelectOptions( $options ) { + protected function makeSelectOptions( $options ) { $preLimitTail = $postLimitTail = ''; $startOpts = ''; @@ -1201,7 +1188,7 @@ * @see DatabaseBase::select() * @since 1.21 */ - public function makeGroupByWithHaving( $options ) { + protected function makeGroupByWithHaving( $options ) { $sql = ''; if ( isset( $options['GROUP BY'] ) ) { $gb = is_array( $options['GROUP BY'] ) @@ -1227,7 +1214,7 @@ * @see DatabaseBase::select() * @since 1.21 */ - public function makeOrderBy( $options ) { + protected function makeOrderBy( $options ) { if ( isset( $options['ORDER BY'] ) ) { $ob = is_array( $options['ORDER BY'] ) ? implode( ',', $options['ORDER BY'] ) @@ -1512,7 +1499,7 @@ return implode( ' ', $opts ); } - function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) { + public function update( $table, $values, $conds, $fname = __METHOD__, $options = [] ) {