From 17da093eb9ab8ffc02a7691a6f70d48546117d9e Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 1 Sep 2010 18:16:05 +0000 Subject: [PATCH] More duplication reduction --- includes/installer/DatabaseInstaller.php | 5 ++++- includes/installer/MysqlInstaller.php | 6 +----- includes/installer/SqliteInstaller.php | 6 +----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 986d68f279..d3727d87b7 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -424,4 +424,7 @@ abstract class DatabaseInstaller { return Status::newGood(); } -} \ No newline at end of file + public function outputHandler( $string ) { + return htmlspecialchars( $string ); + } +} diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 6a3f2f1a1e..7be7ff6ab3 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -198,7 +198,7 @@ class MysqlInstaller extends DatabaseInstaller { $ret = true; - ob_start( array( __CLASS__, 'outputHandler' ) ); + ob_start( array( $this, 'outputHandler' ) ); try { do_all_updates( false, true ); } catch ( MWException $e ) { @@ -210,10 +210,6 @@ class MysqlInstaller extends DatabaseInstaller { return $ret; } - public static function outputHandler( $string ) { - return htmlspecialchars( $string ); - } - /** * Get a list of storage engines that are available and supported */ diff --git a/includes/installer/SqliteInstaller.php b/includes/installer/SqliteInstaller.php index 68fc6e36c8..08eea76b22 100644 --- a/includes/installer/SqliteInstaller.php +++ b/includes/installer/SqliteInstaller.php @@ -186,16 +186,12 @@ class SqliteInstaller extends DatabaseInstaller { global $wgDatabase; LBFactory::enableBackend(); $wgDatabase = wfGetDB( DB_MASTER ); - ob_start( array( 'SqliteInstaller', 'outputHandler' ) ); + ob_start( array( $this, 'outputHandler' ) ); do_all_updates( false, true ); ob_end_flush(); return true; } - public static function outputHandler( $string ) { - return htmlspecialchars( $string ); - } - public function getLocalSettings() { $dir = LocalSettingsGenerator::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) ); return -- 2.20.1