http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100126
Revision: 100126
Author: reedy
Date: 2011-10-18 17:26:09 +0000 (Tue, 18 Oct 2011)
Log Message:
-----------
Add documentation
Fix some unused variables, commented some others out
Modified Paths:
--------------
trunk/phase3/includes/installer/DatabaseInstaller.php
trunk/phase3/includes/installer/Ibm_db2Installer.php
trunk/phase3/includes/installer/Installer.php
trunk/phase3/includes/installer/LocalSettingsGenerator.php
trunk/phase3/includes/installer/MysqlInstaller.php
trunk/phase3/includes/installer/OracleInstaller.php
trunk/phase3/includes/installer/PostgresInstaller.php
trunk/phase3/includes/installer/WebInstaller.php
trunk/phase3/includes/installer/WebInstallerPage.php
Modified: trunk/phase3/includes/installer/DatabaseInstaller.php
===================================================================
--- trunk/phase3/includes/installer/DatabaseInstaller.php 2011-10-18
17:24:53 UTC (rev 100125)
+++ trunk/phase3/includes/installer/DatabaseInstaller.php 2011-10-18
17:26:09 UTC (rev 100126)
@@ -281,6 +281,7 @@
/**
* Construct and initialise parent.
* This is typically only called from Installer::getDBInstaller()
+ * @param $parent
*/
public function __construct( $parent ) {
$this->parent = $parent;
@@ -291,6 +292,8 @@
* Check if a named extension is present.
*
* @see wfDl
+ * @param $name
+ * @return bool
*/
protected static function checkExtension( $name ) {
wfSuppressWarnings();
@@ -323,6 +326,9 @@
/**
* Get a variable, taking local defaults into account.
+ * @param $var string
+ * @param $default null
+ * @return mixed
*/
public function getVar( $var, $default = null ) {
$defaults = $this->getGlobalDefaults();
@@ -337,6 +343,8 @@
/**
* Convenience alias for $this->parent->setVar()
+ * @param $name string
+ * @param $value mixed
*/
public function setVar( $name, $value ) {
$this->parent->setVar( $name, $value );
@@ -345,6 +353,10 @@
/**
* Get a labelled text box to configure a local variable.
*
+ * @param $var string
+ * @param $label string
+ * @param $attribs array
+ * @param $helpData string
* @return string
*/
public function getTextBox( $var, $label, $attribs = array(), $helpData
= "" ) {
@@ -367,6 +379,10 @@
* Get a labelled password box to configure a local variable.
* Implements password hiding.
*
+ * @param $var string
+ * @param $label string
+ * @param $attribs array
+ * @param $helpData string
* @return string
*/
public function getPasswordBox( $var, $label, $attribs = array(),
$helpData = "" ) {
Modified: trunk/phase3/includes/installer/Ibm_db2Installer.php
===================================================================
--- trunk/phase3/includes/installer/Ibm_db2Installer.php 2011-10-18
17:24:53 UTC (rev 100125)
+++ trunk/phase3/includes/installer/Ibm_db2Installer.php 2011-10-18
17:26:09 UTC (rev 100126)
@@ -144,6 +144,9 @@
if ( !$status->isOK() ) {
return $status;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$dbName = $this->getVar( 'wgDBname' );
if( !$conn->selectDB( $dbName ) ) {
Modified: trunk/phase3/includes/installer/Installer.php
===================================================================
--- trunk/phase3/includes/installer/Installer.php 2011-10-18 17:24:53 UTC
(rev 100125)
+++ trunk/phase3/includes/installer/Installer.php 2011-10-18 17:26:09 UTC
(rev 100126)
@@ -1118,6 +1118,9 @@
/**
* Same as locateExecutable(), but checks in getPossibleBinPaths() by
default
* @see locateExecutable()
+ * @param $names
+ * @param $versionInfo bool
+ * @return bool|string
*/
public static function locateExecutableInDefaultPaths( $names,
$versionInfo = false ) {
foreach( self::getPossibleBinPaths() as $path ) {
@@ -1204,6 +1207,8 @@
/**
* Overridden by WebInstaller to provide lastPage parameters.
+ * @param $page stirng
+ * @return string
*/
protected function getDocUrl( $page ) {
return "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
@@ -1491,6 +1496,7 @@
/**
* Insert Main Page with default content.
*
+ * @param $installer DatabaseInstaller
* @return Status
*/
protected function createMainpage( DatabaseInstaller $installer ) {
Modified: trunk/phase3/includes/installer/LocalSettingsGenerator.php
===================================================================
--- trunk/phase3/includes/installer/LocalSettingsGenerator.php 2011-10-18
17:24:53 UTC (rev 100125)
+++ trunk/phase3/includes/installer/LocalSettingsGenerator.php 2011-10-18
17:26:09 UTC (rev 100126)
@@ -187,7 +187,7 @@
$locale = '';
}
- $rightsUrl = $this->values['wgRightsUrl'] ? '' : '#';
+ //$rightsUrl = $this->values['wgRightsUrl'] ? '' : '#'; //
TODO: Fixme, I'm unused!
$hashedUploads = $this->safeMode ? '' : '#';
$metaNamespace = '';
if( $this->values['wgMetaNamespace'] !==
$this->values['wgSitename'] ) {
Modified: trunk/phase3/includes/installer/MysqlInstaller.php
===================================================================
--- trunk/phase3/includes/installer/MysqlInstaller.php 2011-10-18 17:24:53 UTC
(rev 100125)
+++ trunk/phase3/includes/installer/MysqlInstaller.php 2011-10-18 17:26:09 UTC
(rev 100126)
@@ -113,6 +113,9 @@
if ( !$status->isOK() ) {
return $status;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
// Check version
@@ -154,6 +157,9 @@
$this->parent->showStatusError( $status );
return;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$conn->selectDB( $this->getVar( 'wgDBname' ) );
@@ -212,6 +218,9 @@
if ( !$status->isOK() ) {
return $engines;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$version = $conn->getServerVersion();
@@ -259,6 +268,9 @@
if ( !$status->isOK() ) {
return false;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
// Check version, need INFORMATION_SCHEMA and CREATE USER
Modified: trunk/phase3/includes/installer/OracleInstaller.php
===================================================================
--- trunk/phase3/includes/installer/OracleInstaller.php 2011-10-18 17:24:53 UTC
(rev 100125)
+++ trunk/phase3/includes/installer/OracleInstaller.php 2011-10-18 17:26:09 UTC
(rev 100126)
@@ -117,6 +117,10 @@
return $statusIS3;
}
}
+
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
// Check version
Modified: trunk/phase3/includes/installer/PostgresInstaller.php
===================================================================
--- trunk/phase3/includes/installer/PostgresInstaller.php 2011-10-18
17:24:53 UTC (rev 100125)
+++ trunk/phase3/includes/installer/PostgresInstaller.php 2011-10-18
17:26:09 UTC (rev 100126)
@@ -80,6 +80,9 @@
if ( !$status->isOK() ) {
return $status;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
// Check version
@@ -139,6 +142,9 @@
$status = $this->openPgConnection( $type );
if ( $status->isOK() ) {
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$conn->clearFlag( DBO_TRX );
$conn->commit();
@@ -186,6 +192,9 @@
case 'create-tables':
$status = $this->openPgConnection(
'create-schema' );
if ( $status->isOK() ) {
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$safeRole = $conn->addIdentifierQuotes(
$this->getVar( 'wgDBuser' ) );
$conn->query( "SET ROLE $safeRole" );
@@ -204,6 +213,7 @@
if ( !in_array( $this->getVar( 'wgDBname' ), $dbs ) ) {
array_unshift( $dbs, $this->getVar( 'wgDBname' ) );
}
+ $conn = false;
$status = Status::newGood();
foreach ( $dbs as $db ) {
try {
@@ -233,6 +243,9 @@
if ( !$status->isOK() ) {
return false;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$superuser = $this->getVar( '_InstallUser' );
@@ -418,8 +431,8 @@
$dbName = $this->getVar( 'wgDBname' );
$schema = $this->getVar( 'wgDBmwschema' );
$user = $this->getVar( 'wgDBuser' );
- $safeschema = $conn->addIdentifierQuotes( $schema );
- $safeuser = $conn->addIdentifierQuotes( $user );
+ //$safeschema = $conn->addIdentifierQuotes( $schema );
+ //$safeuser = $conn->addIdentifierQuotes( $user );
$exists = $conn->selectField( '"pg_catalog"."pg_database"', '1',
array( 'datname' => $dbName ), __METHOD__ );
@@ -481,7 +494,7 @@
$schema = $this->getVar( 'wgDBmwschema' );
$safeuser = $conn->addIdentifierQuotes( $this->getVar(
'wgDBuser' ) );
$safepass = $conn->addQuotes( $this->getVar( 'wgDBpassword' ) );
- $safeschema = $conn->addIdentifierQuotes( $schema );
+ //$safeschema = $conn->addIdentifierQuotes( $schema );
// Check if the user already exists
$userExists = $conn->roleExists( $this->getVar( 'wgDBuser' ) );
@@ -532,6 +545,10 @@
if ( !$status->isOK() ) {
return $status;
}
+
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
if( $conn->tableExists( 'user' ) ) {
@@ -567,6 +584,9 @@
if ( !$status->isOK() ) {
return $status;
}
+ /**
+ * @var $conn DatabaseBase
+ */
$conn = $status->value;
$exists = $conn->selectField( '"pg_catalog"."pg_language"', 1,
Modified: trunk/phase3/includes/installer/WebInstaller.php
===================================================================
--- trunk/phase3/includes/installer/WebInstaller.php 2011-10-18 17:24:53 UTC
(rev 100125)
+++ trunk/phase3/includes/installer/WebInstaller.php 2011-10-18 17:26:09 UTC
(rev 100126)
@@ -355,6 +355,7 @@
/**
* Show an error message in a box. Parameters are like wfMsg().
+ * @param $msg
*/
public function showError( $msg /*...*/ ) {
$args = func_get_args();
@@ -366,6 +367,8 @@
/**
* Temporary error handler for session start debugging.
+ * @param $errno
+ * @param $errstr string
*/
public function errorHandler( $errno, $errstr ) {
$this->phpErrors[] = $errstr;
@@ -630,6 +633,7 @@
* Get small text indented help for a preceding form field.
* Parameters like wfMsg().
*
+ * @param $msg
* @return string
*/
public function getHelpBox( $msg /*, ... */ ) {
@@ -638,7 +642,7 @@
$args = array_map( 'htmlspecialchars', $args );
$text = wfMsgReal( $msg, $args, false, false, false );
$html = htmlspecialchars( $text );
- $html = $this->parse( $text, true );
+ $html = $this->parse( $html, true );
return "<div class=\"mw-help-field-container\">\n" .
"<span class=\"mw-help-field-hint\">" . wfMsgHtml(
'config-help' ) . "</span>\n" .
@@ -687,6 +691,10 @@
* Label a control by wrapping a config-input div around it and putting
a
* label before it.
*
+ * @param $msg
+ * @param $forId
+ * @param $contents
+ * @param $helpData string
* @return string
*/
public function label( $msg, $forId, $contents, $helpData = "" ) {
@@ -1013,6 +1021,7 @@
/**
* Helper for Installer::docLink()
*
+ * @param $page
* @return string
*/
protected function getDocUrl( $page ) {
@@ -1028,6 +1037,9 @@
/**
* Extension tag hook for a documentation link.
*
+ * @param $linkText
+ * @param $attribs
+ * @param $parser
* @return string
*/
public function docLink( $linkText, $attribs, $parser ) {
@@ -1040,6 +1052,9 @@
/**
* Helper for "Download LocalSettings" link on WebInstall_Complete
*
+ * @param $text
+ * @param $attribs
+ * @param $parser
* @return String Html for download link
*/
public function downloadLinkHook( $text, $attribs, $parser ) {
Modified: trunk/phase3/includes/installer/WebInstallerPage.php
===================================================================
--- trunk/phase3/includes/installer/WebInstallerPage.php 2011-10-18
17:24:53 UTC (rev 100125)
+++ trunk/phase3/includes/installer/WebInstallerPage.php 2011-10-18
17:26:09 UTC (rev 100126)
@@ -212,6 +212,10 @@
/**
* Get a <select> for selecting languages.
*
+ * @param $name
+ * @param $label
+ * @param $selectedCode
+ * @param $helpHtml string
* @return string
*/
public function getLanguageSelector( $name, $label, $selectedCode,
$helpHtml = '' ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs