From aafed9f146e97c1ec3884c509b74bf054454d046 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 28 Jan 2011 15:00:18 +0000 Subject: [PATCH] Minor cleanup, docs --- includes/installer/Installer.php | 4 +- includes/installer/PhpBugTests.php | 5 ++- includes/installer/WebInstaller.php | 51 +++++++++++++++++++++---- includes/installer/WebInstallerPage.php | 4 +- 4 files changed, 49 insertions(+), 15 deletions(-) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index d19a33cf61..3e571f5c46 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -24,11 +24,9 @@ abstract class Installer { /** - * TODO: make protected? - * * @var array */ - public $settings; + protected $settings; /** * Cached DB installer instances, access using getDBInstaller(). diff --git a/includes/installer/PhpBugTests.php b/includes/installer/PhpBugTests.php index 0dba34a04e..9cafd150b1 100644 --- a/includes/installer/PhpBugTests.php +++ b/includes/installer/PhpBugTests.php @@ -18,13 +18,15 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @ingroup SpecialPage + * @defgroup PHPBugTests + * @ingroup PHPBugTests */ /** * Test for PHP+libxml2 bug which breaks XML input subtly with certain versions. * Known fixed with PHP 5.2.9 + libxml2-2.7.3 * @see http://bugs.php.net/bug.php?id=45996 + * @ingroup PHPBugTests */ class PhpXmlBugTester { private $parsedData = ''; @@ -46,6 +48,7 @@ class PhpXmlBugTester { /** * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x) * @see http://bugs.php.net/bug.php?id=45996 + * @ingroup PHPBugTests */ class PhpRefCallBugTester { public $ok = false; diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 9f43f04832..e6795244de 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -31,12 +31,13 @@ class WebInstaller extends Installer { * * @var array */ - public $session; + protected $session; /** * Captured PHP error text. Temporary. + * @var array */ - public $phpErrors; + protected $phpErrors; /** * The main sequence of page names. These will be displayed in turn. @@ -44,6 +45,7 @@ class WebInstaller extends Installer { * * Add it here * * Add a config-page- message * * Add a WebInstaller_ class + * @var array */ public $pageSequence = array( 'Language', @@ -60,8 +62,9 @@ class WebInstaller extends Installer { /** * Out of sequence pages, selectable by the user at any time. + * @var array */ - public $otherPages = array( + protected $otherPages = array( 'Restart', 'Readme', 'ReleaseNotes', @@ -72,24 +75,35 @@ class WebInstaller extends Installer { /** * Array of pages which have declared that they have been submitted, have validated * their input, and need no further processing. + * @var array */ - public $happyPages; + protected $happyPages; /** * List of "skipped" pages. These are pages that will automatically continue * to the next page on any GET request. To avoid breaking the "back" button, * they need to be skipped during a back operation. + * @var array */ - public $skippedPages; + protected $skippedPages; /** * Flag indicating that session data may have been lost. + * @var bool */ public $showSessionWarning = false; - public $tabIndex = 1; + /** + * Numeric index of the page we're on + * @var int + */ + protected $tabIndex = 1; - public $currentPageName; + /** + * Name of the page we're on + * @var string + */ + protected $currentPageName; /** * Constructor. @@ -265,6 +279,10 @@ class WebInstaller extends Installer { return $this->finish(); } + /** + * Find the next page in sequence that hasn't been completed + * @return int + */ public function getLowestUnhappy() { if ( count( $this->happyPages ) == 0 ) { return 0; @@ -347,10 +365,20 @@ class WebInstaller extends Installer { return $this->session; } + /** + * We're restarting the installation, reset the session, happyPages, etc + */ + public function reset() { + $this->session = array(); + $this->happyPages = array(); + $this->settings = array(); + } + /** * Get a URL for submission back to the same script. * * @param $query: Array + * @return string */ public function getUrl( $query = array() ) { $url = $this->request->getRequestURL(); @@ -368,7 +396,6 @@ class WebInstaller extends Installer { * Get a WebInstallerPage by name. * * @param $pageName String - * * @return WebInstallerPage */ public function getPageByName( $pageName ) { @@ -396,6 +423,8 @@ class WebInstaller extends Installer { /** * Set a session variable. + * @param $name String key for the variable + * @param $value Mixed */ public function setSession( $name, $value ) { $this->session[$name] = $value; @@ -403,6 +432,7 @@ class WebInstaller extends Installer { /** * Get the next tabindex attribute value. + * @return int */ public function nextTabIndex() { return $this->tabIndex++; @@ -608,6 +638,7 @@ class WebInstaller extends Installer { /** * Output a help box. + * @param $msg String key for wfMsg() */ public function showHelpBox( $msg /*, ... */ ) { $args = func_get_args(); @@ -920,6 +951,10 @@ class WebInstaller extends Installer { return $url; } + /** + * Helper for "Download LocalSettings" link on WebInstall_Complete + * @return String Html for download link + */ public function downloadLinkHook( $text, $attribs, $parser ) { $img = Html::element( 'img', array( 'src' => '../skins/common/images/download-32.png', diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index d1b7f51169..8ed0b2dd76 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -1082,9 +1082,7 @@ class WebInstaller_Restart extends WebInstallerPage { if ( $r->wasPosted() ) { $really = $r->getVal( 'submit-restart' ); if ( $really ) { - $this->parent->session = array(); - $this->parent->happyPages = array(); - $this->parent->settings = array(); + $this->parent->reset(); } return 'continue'; } -- 2.20.1