Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/97505
Change subject: Remove unused local variables, update formatting and
documentation
......................................................................
Remove unused local variables, update formatting and documentation
Change-Id: Ib17f5f05d6cc48ac448df0ea8515d570713df9b5
---
M includes/installer/Installer.php
M includes/installer/MysqlInstaller.php
M includes/installer/MysqlUpdater.php
M includes/installer/OracleInstaller.php
M includes/installer/SqliteUpdater.php
M includes/installer/WebInstaller.php
M includes/installer/WebInstallerOutput.php
7 files changed, 31 insertions(+), 27 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/05/97505/1
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php
index e6b0fd3..765838b 100644
--- a/includes/installer/Installer.php
+++ b/includes/installer/Installer.php
@@ -1152,11 +1152,11 @@
return chr( 0xC0 | $c >> 6 ) . chr( 0x80 | $c & 0x3F );
} elseif ( $c <= 0xFFFF ) {
return chr( 0xE0 | $c >> 12 ) . chr( 0x80 | $c >> 6 &
0x3F )
- . chr( 0x80 | $c & 0x3F );
+ . chr( 0x80 | $c & 0x3F );
} elseif ( $c <= 0x10FFFF ) {
return chr( 0xF0 | $c >> 18 ) . chr( 0x80 | $c >> 12 &
0x3F )
- . chr( 0x80 | $c >> 6 & 0x3F )
- . chr( 0x80 | $c & 0x3F );
+ . chr( 0x80 | $c >> 6 & 0x3F )
+ . chr( 0x80 | $c & 0x3F );
} else {
return false;
}
@@ -1744,7 +1744,7 @@
$GLOBALS['wgMaxShellMemory'] = 0;
// Don't bother embedding images into generated CSS, which is
not cached
- $GLOBALS['wgResourceLoaderLESSFunctions']['embeddable'] =
function( $frame, $less ) {
+ $GLOBALS['wgResourceLoaderLESSFunctions']['embeddable'] =
function ( $frame, $less ) {
return $less->toBool( false );
};
}
diff --git a/includes/installer/MysqlInstaller.php
b/includes/installer/MysqlInstaller.php
index 5f76972c..2d43324 100644
--- a/includes/installer/MysqlInstaller.php
+++ b/includes/installer/MysqlInstaller.php
@@ -268,9 +268,7 @@
if ( !$status->isOK() ) {
return false;
}
- /**
- * @var $conn DatabaseBase
- */
+ /** @var $conn DatabaseBase */
$conn = $status->value;
// Get current account name
@@ -436,13 +434,14 @@
if ( !$create ) {
// Test the web account
try {
- $db = DatabaseBase::factory( 'mysql', array(
+ DatabaseBase::factory( 'mysql', array(
'host' => $this->getVar( 'wgDBserver' ),
'user' => $this->getVar( 'wgDBuser' ),
'password' => $this->getVar(
'wgDBpassword' ),
'dbname' => false,
'flags' => 0,
- 'tablePrefix' => $this->getVar(
'wgDBprefix' ) ) );
+ 'tablePrefix' => $this->getVar(
'wgDBprefix' )
+ ) );
} catch ( DBConnectionError $e ) {
return Status::newFatal(
'config-connection-error', $e->getMessage() );
}
@@ -479,6 +478,7 @@
if ( !$status->isOK() ) {
return $status;
}
+ /** @var DatabaseBase $conn */
$conn = $status->value;
$dbName = $this->getVar( 'wgDBname' );
if ( !$conn->selectDB( $dbName ) ) {
@@ -516,13 +516,14 @@
if ( $this->getVar( '_CreateDBAccount' ) ) {
// Before we blindly try to create a user that already
has access,
try { // first attempt to connect to the database
- $db = DatabaseBase::factory( 'mysql', array(
+ DatabaseBase::factory( 'mysql', array(
'host' => $server,
'user' => $dbUser,
'password' => $password,
'dbname' => false,
'flags' => 0,
- 'tablePrefix' => $this->getVar(
'wgDBprefix' ) ) );
+ 'tablePrefix' => $this->getVar(
'wgDBprefix' )
+ ) );
$grantableNames[] = $this->buildFullUserName(
$dbUser, $server );
$tryToCreate = false;
} catch ( DBConnectionError $e ) {
diff --git a/includes/installer/MysqlUpdater.php
b/includes/installer/MysqlUpdater.php
index 0f4faec..29b7a47 100644
--- a/includes/installer/MysqlUpdater.php
+++ b/includes/installer/MysqlUpdater.php
@@ -34,8 +34,8 @@
array( 'disableContentHandlerUseDB' ),
// 1.2
- array( 'addField', 'ipblocks', 'ipb_id',
'patch-ipblocks.sql' ),
- array( 'addField', 'ipblocks', 'ipb_expiry',
'patch-ipb_expiry.sql' ),
+ array( 'addField', 'ipblocks', 'ipb_id',
'patch-ipblocks.sql' ),
+ array( 'addField', 'ipblocks', 'ipb_expiry',
'patch-ipb_expiry.sql' ),
array( 'doInterwikiUpdate' ),
array( 'doIndexUpdate' ),
array( 'addTable', 'hitcounter', 'patch-hitcounter.sql'
),
@@ -217,13 +217,13 @@
// 1.21
array( 'addField', 'revision', 'rev_content_format',
'patch-revision-rev_content_format.sql' ),
array( 'addField', 'revision', 'rev_content_model',
'patch-revision-rev_content_model.sql' ),
- array( 'addField', 'archive',
'ar_content_format', 'patch-archive-ar_content_format.sql' ),
- array( 'addField', 'archive',
'ar_content_model', 'patch-archive-ar_content_model.sql' ),
- array( 'addField', 'page',
'page_content_model', 'patch-page-page_content_model.sql' ),
+ array( 'addField', 'archive', 'ar_content_format',
'patch-archive-ar_content_format.sql' ),
+ array( 'addField', 'archive', 'ar_content_model',
'patch-archive-ar_content_model.sql' ),
+ array( 'addField', 'page', 'page_content_model',
'patch-page-page_content_model.sql' ),
array( 'enableContentHandlerUseDB' ),
- array( 'dropField', 'site_stats', 'ss_admins',
'patch-drop-ss_admins.sql' ),
- array( 'dropField', 'recentchanges',
'rc_moved_to_title', 'patch-rc_moved.sql' ),
- array( 'addTable', 'sites',
'patch-sites.sql' ),
+ array( 'dropField', 'site_stats', 'ss_admins',
'patch-drop-ss_admins.sql' ),
+ array( 'dropField', 'recentchanges',
'rc_moved_to_title', 'patch-rc_moved.sql' ),
+ array( 'addTable', 'sites', 'patch-sites.sql' ),
array( 'addField', 'filearchive', 'fa_sha1',
'patch-fa_sha1.sql' ),
array( 'addField', 'job', 'job_token',
'patch-job_token.sql' ),
array( 'addField', 'job', 'job_attempts',
'patch-job_attempts.sql' ),
@@ -260,6 +260,7 @@
return true;
}
+ /** @var MySQLField $fieldInfo */
$fieldInfo = $this->db->fieldInfo( $table, $field );
if ( $fieldInfo->isBinary() ) {
$this->output( "...$table table has correct $field
encoding.\n" );
diff --git a/includes/installer/OracleInstaller.php
b/includes/installer/OracleInstaller.php
index 7757510..113dce6 100644
--- a/includes/installer/OracleInstaller.php
+++ b/includes/installer/OracleInstaller.php
@@ -247,6 +247,7 @@
return $status;
}
}
+
$this->db = $status->value;
$this->setupSchemaVars();
diff --git a/includes/installer/SqliteUpdater.php
b/includes/installer/SqliteUpdater.php
index 6fa22bc..954c298 100644
--- a/includes/installer/SqliteUpdater.php
+++ b/includes/installer/SqliteUpdater.php
@@ -34,7 +34,7 @@
array( 'disableContentHandlerUseDB' ),
// 1.14
- array( 'addField', 'site_stats', 'ss_active_users',
'patch-ss_active_users.sql' ),
+ array( 'addField', 'site_stats', 'ss_active_users',
'patch-ss_active_users.sql' ),
array( 'doActiveUsersInit' ),
array( 'addField', 'ipblocks', 'ipb_allow_usertalk',
'patch-ipb_allow_usertalk.sql' ),
array( 'sqliteInitialIndexes' ),
@@ -96,12 +96,12 @@
// 1.21
array( 'addField', 'revision', 'rev_content_format',
'patch-revision-rev_content_format.sql' ),
array( 'addField', 'revision', 'rev_content_model',
'patch-revision-rev_content_model.sql' ),
- array( 'addField', 'archive', 'ar_content_format',
'patch-archive-ar_content_format.sql' ),
- array( 'addField', 'archive', 'ar_content_model',
'patch-archive-ar_content_model.sql' ),
- array( 'addField', 'page', 'page_content_model',
'patch-page-page_content_model.sql' ),
+ array( 'addField', 'archive', 'ar_content_format',
'patch-archive-ar_content_format.sql' ),
+ array( 'addField', 'archive', 'ar_content_model',
'patch-archive-ar_content_model.sql' ),
+ array( 'addField', 'page', 'page_content_model',
'patch-page-page_content_model.sql' ),
array( 'enableContentHandlerUseDB' ),
- array( 'dropField', 'site_stats', 'ss_admins',
'patch-drop-ss_admins.sql' ),
+ array( 'dropField', 'site_stats', 'ss_admins',
'patch-drop-ss_admins.sql' ),
array( 'dropField', 'recentchanges',
'rc_moved_to_title', 'patch-rc_moved.sql' ),
array( 'addTable', 'sites', 'patch-sites.sql' ),
array( 'addField', 'filearchive', 'fa_sha1',
'patch-fa_sha1.sql' ),
diff --git a/includes/installer/WebInstaller.php
b/includes/installer/WebInstaller.php
index b37e6b3..79fdc99 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -326,6 +326,7 @@
/**
* Start the PHP session. This may be called before execute() to start
the PHP session.
*
+ * @throws Exception
* @return bool
*/
public function startSession() {
diff --git a/includes/installer/WebInstallerOutput.php
b/includes/installer/WebInstallerOutput.php
index fd91bcb..00a4ff8 100644
--- a/includes/installer/WebInstallerOutput.php
+++ b/includes/installer/WebInstallerOutput.php
@@ -124,9 +124,9 @@
$prepend = '';
$css = '';
- $cssFileNames = array();
$resourceLoader = new ResourceLoader();
foreach ( $moduleNames as $moduleName ) {
+ /** @var ResourceLoaderFileModule $module */
$module = $resourceLoader->getModule( $moduleName );
$cssFileNames = $module->getAllStyleFiles();
@@ -138,7 +138,8 @@
}
if ( !is_readable( $cssFileName ) ) {
- $prepend .=
ResourceLoader::makeComment( "Unable to read $cssFileName. Please check file
permissions." );
+ $prepend .=
ResourceLoader::makeComment( "Unable to read $cssFileName. " .
+ "Please check file
permissions." );
continue;
}
@@ -170,7 +171,6 @@
} else {
$prepend .=
ResourceLoader::makeComment( "Unable to read $cssFileName." );
}
-
} catch ( Exception $e ) {
$prepend .=
ResourceLoader::formatException( $e );
}
--
To view, visit https://gerrit.wikimedia.org/r/97505
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib17f5f05d6cc48ac448df0ea8515d570713df9b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits