Index: trunk/phase3/includes/installer/WebInstaller.php |
— | — | @@ -128,7 +128,7 @@ |
129 | 129 | |
130 | 130 | $lowestUnhappy = $this->getLowestUnhappy(); |
131 | 131 | |
132 | | - # Special case for Creative Commons partner chooser box |
| 132 | + # Special case for Creative Commons partner chooser box. |
133 | 133 | if ( $this->request->getVal( 'SubmitCC' ) ) { |
134 | 134 | $page = $this->getPageByName( 'Options' ); |
135 | 135 | $this->output->useShortHeader(); |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | return $this->finish(); |
145 | 145 | } |
146 | 146 | |
147 | | - # Get the page name |
| 147 | + # Get the page name. |
148 | 148 | $pageName = $this->request->getVal( 'page' ); |
149 | 149 | |
150 | 150 | if ( in_array( $pageName, $this->otherPages ) ) { |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | if ( $pageId > $lowestUnhappy ) { |
164 | 164 | $pageId = $lowestUnhappy; |
165 | 165 | if ( $lowestUnhappy == 0 ) { |
166 | | - # Knocked back to start, possible loss of session data |
| 166 | + # Knocked back to start, possible loss of session data. |
167 | 167 | $this->showSessionWarning = true; |
168 | 168 | } |
169 | 169 | } |
— | — | @@ -171,7 +171,7 @@ |
172 | 172 | $page = $this->getPageByName( $pageName ); |
173 | 173 | } |
174 | 174 | |
175 | | - # If a back button was submitted, go back without submitting the form data |
| 175 | + # If a back button was submitted, go back without submitting the form data. |
176 | 176 | if ( $this->request->wasPosted() && $this->request->getBool( 'submit-back' ) ) { |
177 | 177 | if ( $this->request->getVal( 'lastPage' ) ) { |
178 | 178 | $nextPage = $this->request->getVal( 'lastPage' ); |
— | — | @@ -192,7 +192,7 @@ |
193 | 193 | return $this->finish(); |
194 | 194 | } |
195 | 195 | |
196 | | - # Execute the page |
| 196 | + # Execute the page. |
197 | 197 | $this->currentPageName = $page->getName(); |
198 | 198 | $this->startPageWrapper( $pageName ); |
199 | 199 | $localSettings = $this->getLocalSettingsStatus(); |
— | — | @@ -207,15 +207,15 @@ |
208 | 208 | $this->endPageWrapper(); |
209 | 209 | |
210 | 210 | if ( $result == 'skip' ) { |
211 | | - # Page skipped without explicit submission |
212 | | - # Skip it when we click "back" so that we don't just go forward again |
| 211 | + # Page skipped without explicit submission. |
| 212 | + # Skip it when we click "back" so that we don't just go forward again. |
213 | 213 | $this->skippedPages[$pageName] = true; |
214 | 214 | $result = 'continue'; |
215 | 215 | } else { |
216 | 216 | unset( $this->skippedPages[$pageName] ); |
217 | 217 | } |
218 | 218 | |
219 | | - # If it was posted, the page can request a continue to the next page |
| 219 | + # If it was posted, the page can request a continue to the next page. |
220 | 220 | if ( $result === 'continue' && !$this->output->headerDone() ) { |
221 | 221 | if ( $pageId !== false ) { |
222 | 222 | $this->happyPages[$pageId] = true; |
Index: trunk/phase3/includes/installer/WebInstallerOutput.php |
— | — | @@ -9,58 +9,70 @@ |
10 | 10 | * that wouldn't be immediately obvious. |
11 | 11 | */ |
12 | 12 | class WebInstallerOutput { |
13 | | - var $parent; |
14 | | - var $contents = ''; |
15 | | - var $warnings = ''; |
16 | | - var $headerDone = false; |
17 | | - var $redirectTarget; |
18 | | - var $debug = true; |
19 | | - var $useShortHeader = false; |
| 13 | + |
| 14 | + /** |
| 15 | + * The WebInstaller object this WebInstallerOutput is used by. |
| 16 | + * |
| 17 | + * @var WebInstaller |
| 18 | + */ |
| 19 | + public $parent; |
| 20 | + |
| 21 | + public $contents = ''; |
| 22 | + public $warnings = ''; |
| 23 | + public $headerDone = false; |
| 24 | + public $redirectTarget; |
| 25 | + public $debug = true; |
| 26 | + public $useShortHeader = false; |
20 | 27 | |
21 | | - function __construct( $parent ) { |
| 28 | + /** |
| 29 | + * Constructor. |
| 30 | + * |
| 31 | + * @param WebInstaller $parent |
| 32 | + */ |
| 33 | + public function __construct( WebInstaller $parent ) { |
22 | 34 | $this->parent = $parent; |
23 | 35 | } |
24 | 36 | |
25 | | - function addHTML( $html ) { |
| 37 | + public function addHTML( $html ) { |
26 | 38 | $this->contents .= $html; |
27 | 39 | $this->flush(); |
28 | 40 | } |
29 | 41 | |
30 | | - function addWikiText( $text ) { |
| 42 | + public function addWikiText( $text ) { |
31 | 43 | $this->addHTML( $this->parent->parse( $text ) ); |
32 | 44 | } |
33 | 45 | |
34 | | - function addHTMLNoFlush( $html ) { |
| 46 | + public function addHTMLNoFlush( $html ) { |
35 | 47 | $this->contents .= $html; |
36 | 48 | } |
37 | 49 | |
38 | | - function addWarning( $msg ) { |
| 50 | + public function addWarning( $msg ) { |
39 | 51 | $this->warnings .= "<p>$msg</p>\n"; |
40 | 52 | } |
41 | 53 | |
42 | | - function addWarningMsg( $msg /*, ... */ ) { |
| 54 | + public function addWarningMsg( $msg /*, ... */ ) { |
43 | 55 | $params = func_get_args(); |
44 | 56 | array_shift( $params ); |
45 | 57 | $this->addWarning( wfMsg( $msg, $params ) ); |
46 | 58 | } |
47 | 59 | |
48 | | - function redirect( $url ) { |
| 60 | + public function redirect( $url ) { |
49 | 61 | if ( $this->headerDone ) { |
50 | 62 | throw new MWException( __METHOD__ . ' called after sending headers' ); |
51 | 63 | } |
52 | 64 | $this->redirectTarget = $url; |
53 | 65 | } |
54 | 66 | |
55 | | - function output() { |
| 67 | + public function output() { |
56 | 68 | $this->flush(); |
57 | 69 | $this->outputFooter(); |
58 | 70 | } |
59 | 71 | |
60 | | - function useShortHeader( $use = true ) { |
| 72 | + public function useShortHeader( $use = true ) { |
61 | 73 | $this->useShortHeader = $use; |
62 | 74 | } |
63 | 75 | |
64 | | - function flush() { |
| 76 | + public function flush() { |
65 | 77 | if ( !$this->headerDone ) { |
66 | 78 | $this->outputHeader(); |
67 | 79 | } |
— | — | @@ -72,7 +84,7 @@ |
73 | 85 | } |
74 | 86 | } |
75 | 87 | |
76 | | - function getDir() { |
| 88 | + public function getDir() { |
77 | 89 | global $wgLang; |
78 | 90 | if( !is_object( $wgLang ) || !$wgLang->isRtl() ) |
79 | 91 | return 'ltr'; |
— | — | @@ -80,7 +92,7 @@ |
81 | 93 | return 'rtl'; |
82 | 94 | } |
83 | 95 | |
84 | | - function getLanguageCode() { |
| 96 | + public function getLanguageCode() { |
85 | 97 | global $wgLang; |
86 | 98 | if( !is_object( $wgLang ) ) |
87 | 99 | return 'en'; |
— | — | @@ -88,18 +100,18 @@ |
89 | 101 | return $wgLang->getCode(); |
90 | 102 | } |
91 | 103 | |
92 | | - function getHeadAttribs() { |
| 104 | + public function getHeadAttribs() { |
93 | 105 | return array( |
94 | 106 | 'dir' => $this->getDir(), |
95 | 107 | 'lang' => $this->getLanguageCode(), |
96 | 108 | ); |
97 | 109 | } |
98 | 110 | |
99 | | - function headerDone() { |
| 111 | + public function headerDone() { |
100 | 112 | return $this->headerDone; |
101 | 113 | } |
102 | 114 | |
103 | | - function outputHeader() { |
| 115 | + public function outputHeader() { |
104 | 116 | $this->headerDone = true; |
105 | 117 | $dbTypes = $this->parent->getDBTypes(); |
106 | 118 | |
— | — | @@ -144,7 +156,7 @@ |
145 | 157 | <?php |
146 | 158 | } |
147 | 159 | |
148 | | - function outputFooter() { |
| 160 | + public function outputFooter() { |
149 | 161 | $this->outputWarnings(); |
150 | 162 | |
151 | 163 | if ( $this->useShortHeader ) { |
— | — | @@ -179,7 +191,7 @@ |
180 | 192 | <?php |
181 | 193 | } |
182 | 194 | |
183 | | - function outputShortHeader() { |
| 195 | + public function outputShortHeader() { |
184 | 196 | ?> |
185 | 197 | <?php echo Html::htmlHeader( $this->getHeadAttribs() ); ?> |
186 | 198 | <head> |
— | — | @@ -196,18 +208,19 @@ |
197 | 209 | <?php |
198 | 210 | } |
199 | 211 | |
200 | | - function outputTitle() { |
| 212 | + public function outputTitle() { |
201 | 213 | global $wgVersion; |
202 | 214 | echo htmlspecialchars( wfMsg( 'config-title', $wgVersion ) ); |
203 | 215 | } |
204 | 216 | |
205 | | - function outputJQuery() { |
| 217 | + public function outputJQuery() { |
206 | 218 | global $wgJQueryVersion; |
207 | 219 | echo Html::linkedScript( "../skins/common/jquery-$wgJQueryVersion.min.js" ); |
208 | 220 | } |
209 | 221 | |
210 | | - function outputWarnings() { |
| 222 | + public function outputWarnings() { |
211 | 223 | $this->addHTML( $this->warnings ); |
212 | 224 | $this->warnings = ''; |
213 | 225 | } |
214 | | -} |
| 226 | + |
| 227 | +} |
\ No newline at end of file |
Index: trunk/phase3/includes/installer/WebInstallerPage.php |
— | — | @@ -14,8 +14,12 @@ |
15 | 15 | |
16 | 16 | public abstract function execute(); |
17 | 17 | |
| 18 | + /** |
| 19 | + * Constructor. |
| 20 | + * |
| 21 | + * @param WebInstaller $parent |
| 22 | + */ |
18 | 23 | public function __construct( WebInstaller $parent ) { |
19 | | - // TODO: This field is not defined?? |
20 | 24 | $this->parent = $parent; |
21 | 25 | } |
22 | 26 | |