Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -31,12 +31,13 @@ |
32 | 32 | * |
33 | 33 | * @var array |
34 | 34 | */ |
35 | | - public $session; |
| 35 | + protected $session; |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * Captured PHP error text. Temporary. |
| 39 | + * @var array |
39 | 40 | */ |
40 | | - public $phpErrors; |
| 41 | + protected $phpErrors; |
41 | 42 | |
42 | 43 | /** |
43 | 44 | * The main sequence of page names. These will be displayed in turn. |
— | — | @@ -44,6 +45,7 @@ |
45 | 46 | * * Add it here |
46 | 47 | * * Add a config-page-<name> message |
47 | 48 | * * Add a WebInstaller_<name> class |
| 49 | + * @var array |
48 | 50 | */ |
49 | 51 | public $pageSequence = array( |
50 | 52 | 'Language', |
— | — | @@ -60,8 +62,9 @@ |
61 | 63 | |
62 | 64 | /** |
63 | 65 | * Out of sequence pages, selectable by the user at any time. |
| 66 | + * @var array |
64 | 67 | */ |
65 | | - public $otherPages = array( |
| 68 | + protected $otherPages = array( |
66 | 69 | 'Restart', |
67 | 70 | 'Readme', |
68 | 71 | 'ReleaseNotes', |
— | — | @@ -72,24 +75,35 @@ |
73 | 76 | /** |
74 | 77 | * Array of pages which have declared that they have been submitted, have validated |
75 | 78 | * their input, and need no further processing. |
| 79 | + * @var array |
76 | 80 | */ |
77 | | - public $happyPages; |
| 81 | + protected $happyPages; |
78 | 82 | |
79 | 83 | /** |
80 | 84 | * List of "skipped" pages. These are pages that will automatically continue |
81 | 85 | * to the next page on any GET request. To avoid breaking the "back" button, |
82 | 86 | * they need to be skipped during a back operation. |
| 87 | + * @var array |
83 | 88 | */ |
84 | | - public $skippedPages; |
| 89 | + protected $skippedPages; |
85 | 90 | |
86 | 91 | /** |
87 | 92 | * Flag indicating that session data may have been lost. |
| 93 | + * @var bool |
88 | 94 | */ |
89 | 95 | public $showSessionWarning = false; |
90 | 96 | |
91 | | - public $tabIndex = 1; |
| 97 | + /** |
| 98 | + * Numeric index of the page we're on |
| 99 | + * @var int |
| 100 | + */ |
| 101 | + protected $tabIndex = 1; |
92 | 102 | |
93 | | - public $currentPageName; |
| 103 | + /** |
| 104 | + * Name of the page we're on |
| 105 | + * @var string |
| 106 | + */ |
| 107 | + protected $currentPageName; |
94 | 108 | |
95 | 109 | /** |
96 | 110 | * Constructor. |
— | — | @@ -265,6 +279,10 @@ |
266 | 280 | return $this->finish(); |
267 | 281 | } |
268 | 282 | |
| 283 | + /** |
| 284 | + * Find the next page in sequence that hasn't been completed |
| 285 | + * @return int |
| 286 | + */ |
269 | 287 | public function getLowestUnhappy() { |
270 | 288 | if ( count( $this->happyPages ) == 0 ) { |
271 | 289 | return 0; |
— | — | @@ -348,9 +366,19 @@ |
349 | 367 | } |
350 | 368 | |
351 | 369 | /** |
| 370 | + * We're restarting the installation, reset the session, happyPages, etc |
| 371 | + */ |
| 372 | + public function reset() { |
| 373 | + $this->session = array(); |
| 374 | + $this->happyPages = array(); |
| 375 | + $this->settings = array(); |
| 376 | + } |
| 377 | + |
| 378 | + /** |
352 | 379 | * Get a URL for submission back to the same script. |
353 | 380 | * |
354 | 381 | * @param $query: Array |
| 382 | + * @return string |
355 | 383 | */ |
356 | 384 | public function getUrl( $query = array() ) { |
357 | 385 | $url = $this->request->getRequestURL(); |
— | — | @@ -368,7 +396,6 @@ |
369 | 397 | * Get a WebInstallerPage by name. |
370 | 398 | * |
371 | 399 | * @param $pageName String |
372 | | - * |
373 | 400 | * @return WebInstallerPage |
374 | 401 | */ |
375 | 402 | public function getPageByName( $pageName ) { |
— | — | @@ -396,6 +423,8 @@ |
397 | 424 | |
398 | 425 | /** |
399 | 426 | * Set a session variable. |
| 427 | + * @param $name String key for the variable |
| 428 | + * @param $value Mixed |
400 | 429 | */ |
401 | 430 | public function setSession( $name, $value ) { |
402 | 431 | $this->session[$name] = $value; |
— | — | @@ -403,6 +432,7 @@ |
404 | 433 | |
405 | 434 | /** |
406 | 435 | * Get the next tabindex attribute value. |
| 436 | + * @return int |
407 | 437 | */ |
408 | 438 | public function nextTabIndex() { |
409 | 439 | return $this->tabIndex++; |
— | — | @@ -608,6 +638,7 @@ |
609 | 639 | |
610 | 640 | /** |
611 | 641 | * Output a help box. |
| 642 | + * @param $msg String key for wfMsg() |
612 | 643 | */ |
613 | 644 | public function showHelpBox( $msg /*, ... */ ) { |
614 | 645 | $args = func_get_args(); |
— | — | @@ -920,6 +951,10 @@ |
921 | 952 | return $url; |
922 | 953 | } |
923 | 954 | |
| 955 | + /** |
| 956 | + * Helper for "Download LocalSettings" link on WebInstall_Complete |
| 957 | + * @return String Html for download link |
| 958 | + */ |
924 | 959 | public function downloadLinkHook( $text, $attribs, $parser ) { |
925 | 960 | $img = Html::element( 'img', array( |
926 | 961 | 'src' => '../skins/common/images/download-32.png', |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -24,11 +24,9 @@ |
25 | 25 | abstract class Installer { |
26 | 26 | |
27 | 27 | /** |
28 | | - * TODO: make protected? |
29 | | - * |
30 | 28 | * @var array |
31 | 29 | */ |
32 | | - public $settings; |
| 30 | + protected $settings; |
33 | 31 | |
34 | 32 | /** |
35 | 33 | * Cached DB installer instances, access using getDBInstaller(). |
Index: trunk/phase3/includes/installer/PhpBugTests.php |
— | — | @@ -18,13 +18,15 @@ |
19 | 19 | * http://www.gnu.org/copyleft/gpl.html |
20 | 20 | * |
21 | 21 | * @file |
22 | | - * @ingroup SpecialPage |
| 22 | + * @defgroup PHPBugTests |
| 23 | + * @ingroup PHPBugTests |
23 | 24 | */ |
24 | 25 | |
25 | 26 | /** |
26 | 27 | * Test for PHP+libxml2 bug which breaks XML input subtly with certain versions. |
27 | 28 | * Known fixed with PHP 5.2.9 + libxml2-2.7.3 |
28 | 29 | * @see http://bugs.php.net/bug.php?id=45996 |
| 30 | + * @ingroup PHPBugTests |
29 | 31 | */ |
30 | 32 | class PhpXmlBugTester { |
31 | 33 | private $parsedData = ''; |
— | — | @@ -46,6 +48,7 @@ |
47 | 49 | /** |
48 | 50 | * Test for PHP bug #50394 (PHP 5.3.x conversion to null only, not 5.2.x) |
49 | 51 | * @see http://bugs.php.net/bug.php?id=45996 |
| 52 | + * @ingroup PHPBugTests |
50 | 53 | */ |
51 | 54 | class PhpRefCallBugTester { |
52 | 55 | public $ok = false; |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -1082,9 +1082,7 @@ |
1083 | 1083 | if ( $r->wasPosted() ) { |
1084 | 1084 | $really = $r->getVal( 'submit-restart' ); |
1085 | 1085 | if ( $really ) { |
1086 | | - $this->parent->session = array(); |
1087 | | - $this->parent->happyPages = array(); |
1088 | | - $this->parent->settings = array(); |
| 1086 | + $this->parent->reset(); |
1089 | 1087 | } |
1090 | 1088 | return 'continue'; |
1091 | 1089 | } |