Merge "API: Fix parameter validation in setnotificationtimestamp"
[lhc/web/wiklou.git] / includes / installer / WebInstallerPage.php
index 68e8e11..9119c12 100644 (file)
@@ -84,12 +84,14 @@ abstract class WebInstallerPage {
 
                if ( $continue ) {
                        // Fake submit button for enter keypress (bug 26267)
+                       // Give grep a chance to find the usages: config-continue
                        $s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
                                array( 'name' => "enter-$continue", 'style' =>
                                        'visibility:hidden;overflow:hidden;width:1px;margin:0' ) ) . "\n";
                }
 
                if ( $back ) {
+                       // Give grep a chance to find the usages: config-back
                        $s .= Xml::submitButton( wfMessage( "config-$back" )->text(),
                                array(
                                        'name' => "submit-$back",
@@ -98,6 +100,7 @@ abstract class WebInstallerPage {
                }
 
                if ( $continue ) {
+                       // Give grep a chance to find the usages: config-continue
                        $s .= Xml::submitButton( wfMessage( "config-$continue" )->text(),
                                array(
                                        'name' => "submit-$continue",
@@ -128,7 +131,7 @@ abstract class WebInstallerPage {
        /**
         * Get the starting tags of a fieldset.
         *
-        * @param $legend String: message name
+        * @param string $legend message name
         *
         * @return string
         */
@@ -357,7 +360,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
 
        /**
         * Initiate an upgrade of the existing database
-        * @param $vars array Variables from LocalSettings.php and AdminSettings.php
+        * @param array $vars Variables from LocalSettings.php and AdminSettings.php
         * @return Status
         */
        protected function handleExistingUpgrade( $vars ) {
@@ -369,7 +372,7 @@ class WebInstaller_ExistingWiki extends WebInstallerPage {
 
                // Set the relevant variables from LocalSettings.php
                $requiredVars = array( 'wgDBtype' );
-               $status = $this->importVariables( $requiredVars , $vars );
+               $status = $this->importVariables( $requiredVars, $vars );
                $installer = $this->parent->getDBInstaller();
                $status->merge( $this->importVariables( $installer->getGlobalNames(), $vars ) );
                if ( !$status->isOK() ) {
@@ -452,6 +455,8 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $settings = '';
                $defaultType = $this->getVar( 'wgDBtype' );
 
+               // Give grep a chance to find the usages:
+               // config-support-mysql, config-support-postgres, config-support-oracle, config-support-sqlite
                $dbSupport = '';
                foreach( $this->parent->getDBTypes() as $type ) {
                        $link = DatabaseBase::factory( $type )->getSoftwareLink();
@@ -474,6 +479,8 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                                ) .
                                "</li>\n";
 
+                       // Give grep a chance to find the usages:
+                       // config-header-mysql, config-header-postgres, config-header-oracle, config-header-sqlite
                        $settings .=
                                Html::openElement( 'div', array( 'id' => 'DB_wrapper_' . $type,
                                                'class' => 'dbWrapper' ) ) .
@@ -645,8 +652,11 @@ class WebInstaller_Name extends WebInstallerPage {
                        $this->parent->getTextBox( array(
                                'var' => 'wgSitename',
                                'label' => 'config-site-name',
-                         'help' => $this->parent->getHelpBox( 'config-site-name-help' )
+                               'help' => $this->parent->getHelpBox( 'config-site-name-help' )
                        ) ) .
+                       // getRadioSet() builds a set of labeled radio buttons.
+                       // For grep: The following messages are used as the item labels:
+                       // config-ns-site-name, config-ns-generic, config-ns-other
                        $this->parent->getRadioSet( array(
                                'var' => '_NamespaceType',
                                'label' => 'config-project-namespace',
@@ -688,6 +698,9 @@ class WebInstaller_Name extends WebInstallerPage {
                        ) ) .
                        $this->getFieldSetEnd() .
                        $this->parent->getInfoBox( wfMessage( 'config-almost-done' )->text() ) .
+                       // getRadioSet() builds a set of labeled radio buttons.
+                       // For grep: The following messages are used as the item labels:
+                       // config-optional-continue, config-optional-skip
                        $this->parent->getRadioSet( array(
                                'var' => '_SkipOptional',
                                'itemLabelPrefix' => 'config-optional-',
@@ -831,6 +844,9 @@ class WebInstaller_Options extends WebInstallerPage {
                $this->startForm();
                $this->addHTML(
                        # User Rights
+                       // getRadioSet() builds a set of labeled radio buttons.
+                       // For grep: The following messages are used as the item labels:
+                       // config-profile-wiki, config-profile-no-anon, config-profile-fishbowl, config-profile-private
                        $this->parent->getRadioSet( array(
                                'var' => '_RightsProfile',
                                'label' => 'config-profile',
@@ -840,6 +856,11 @@ class WebInstaller_Options extends WebInstallerPage {
                        $this->parent->getInfoBox( wfMessage( 'config-profile-help' )->plain() ) .
 
                        # Licensing
+                       // getRadioSet() builds a set of labeled radio buttons.
+                       // For grep: The following messages are used as the item labels:
+                       // config-license-cc-by, config-license-cc-by-sa, config-license-cc-by-nc-sa,
+                       // config-license-cc-0, config-license-pd, config-license-gfdl,
+                       // config-license-none, config-license-cc-choose
                        $this->parent->getRadioSet( array(
                                'var' => '_LicenseCode',
                                'label' => 'config-license',
@@ -955,7 +976,7 @@ class WebInstaller_Options extends WebInstallerPage {
 
                // We'll hide/show this on demand when the value changes, see config.js.
                $cacheval = $this->getVar( 'wgMainCacheType' );
-               if (!$cacheval) {
+               if ( !$cacheval ) {
                        // We need to set a default here; but don't hardcode it
                        // or we lose it every time we reload the page for validation
                        // or going back!
@@ -966,6 +987,9 @@ class WebInstaller_Options extends WebInstallerPage {
                        # Advanced settings
                        $this->getFieldSetStart( 'config-advanced-settings' ) .
                        # Object cache settings
+                       // getRadioSet() builds a set of labeled radio buttons.
+                       // For grep: The following messages are used as the item labels:
+                       // config-cache-none, config-cache-accel, config-cache-memcached
                        $this->parent->getRadioSet( array(
                                'var' => 'wgMainCacheType',
                                'label' => 'config-cache-options',
@@ -1025,7 +1049,7 @@ class WebInstaller_Options extends WebInstallerPage {
                } else {
                        $iframeAttribs['src'] = $this->getCCPartnerUrl();
                }
-               $wrapperStyle = ($this->getVar('_LicenseCode') == 'cc-choose') ? '' : 'display: none';
+               $wrapperStyle = ($this->getVar( '_LicenseCode' ) == 'cc-choose') ? '' : 'display: none';
 
                return
                        "<div class=\"config-cc-wrapper\" id=\"config-cc-wrapper\" style=\"$wrapperStyle\">\n" .
@@ -1092,6 +1116,10 @@ class WebInstaller_Options extends WebInstallerPage {
                                return false;
                        }
                } elseif ( in_array( $code, array_keys( $this->parent->licenses ) ) ) {
+                       // Give grep a chance to find the usages:
+                       // config-license-cc-by, config-license-cc-by-sa, config-license-cc-by-nc-sa,
+                       // config-license-cc-0, config-license-pd, config-license-gfdl,
+                       // config-license-none, config-license-cc-choose
                        $entry = $this->parent->licenses[$code];
                        if ( isset( $entry['text'] ) ) {
                                $this->setVar( 'wgRightsText', $entry['text'] );
@@ -1155,12 +1183,12 @@ class WebInstaller_Install extends WebInstallerPage {
                        return 'continue';
                } elseif( $this->parent->request->wasPosted() ) {
                        $this->startForm();
-                       $this->addHTML("<ul>");
+                       $this->addHTML( "<ul>" );
                        $results = $this->parent->performInstallation(
-                               array( $this, 'startStage'),
+                               array( $this, 'startStage' ),
                                array( $this, 'endStage' )
                        );
-                       $this->addHTML("</ul>");
+                       $this->addHTML( "</ul>" );
                        // PerformInstallation bails on a fatal, so make sure the last item
                        // completed before giving 'next.' Likewise, only provide back on failure
                        $lastStep = end( $results );
@@ -1176,7 +1204,7 @@ class WebInstaller_Install extends WebInstallerPage {
        }
 
        public function startStage( $step ) {
-               $this->addHTML( "<li>" . wfMessage( "config-install-$step" )->escaped() . wfMessage( 'ellipsis')->escaped() );
+               $this->addHTML( "<li>" . wfMessage( "config-install-$step" )->escaped() . wfMessage( 'ellipsis' )->escaped() );
                if ( $step == 'extension-tables' ) {
                        $this->startLiveBox();
                }
@@ -1261,7 +1289,7 @@ abstract class WebInstaller_Document extends WebInstallerPage {
 
        abstract protected function getFileName();
 
-       public  function execute() {
+       public function execute() {
                $text = $this->getFileContents();
                $text = InstallDocFormatter::format( $text );
                $this->parent->output->addWikiText( $text );
@@ -1287,8 +1315,8 @@ class WebInstaller_ReleaseNotes extends WebInstaller_Document {
        protected function getFileName() {
                global $wgVersion;
 
-               if(preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
-                       throw new MWException('Variable $wgVersion has an invalid value.');
+               if( !preg_match( '/^(\d+)\.(\d+).*/i', $wgVersion, $result ) ) {
+                       throw new MWException( 'Variable $wgVersion has an invalid value.' );
                }
 
                return 'RELEASE-NOTES-' . $result[1] . '.' . $result[2];
@@ -1302,4 +1330,3 @@ class WebInstaller_UpgradeDoc extends WebInstaller_Document {
 class WebInstaller_Copying extends WebInstaller_Document {
        protected function getFileName() { return 'COPYING'; }
 }
-