Index: trunk/phase3/maintenance/sqlite/archives/patch-tc-timestamp.sql |
— | — | @@ -1,3 +1,3 @@ |
2 | 2 | UPDATE /*_*/transcache SET tc_time = strftime('%Y%m%d%H%M%S', datetime(tc_time, 'unixepoch')); |
3 | 3 | |
4 | | -INSERT INTO /*_*/updatelog VALUES ('convert transcache field'); |
| 4 | +INSERT INTO /*_*/updatelog (ul_key) VALUES ('convert transcache field'); |
Index: trunk/phase3/maintenance/sqlite/archives/initial-indexes.sql |
— | — | @@ -413,4 +413,4 @@ |
414 | 414 | CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title); |
415 | 415 | CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo); |
416 | 416 | |
417 | | -INSERT INTO /*_*/updatelog VALUES ('initial_indexes'); |
| 417 | +INSERT INTO /*_*/updatelog (ul_key) VALUES ('initial_indexes'); |
Index: trunk/phase3/maintenance/sqlite/archives/searchindex-fts3.sql |
— | — | @@ -15,4 +15,4 @@ |
16 | 16 | si_text |
17 | 17 | ); |
18 | 18 | |
19 | | -INSERT INTO /*_*/updatelog VALUES ('fts3'); |
\ No newline at end of file |
| 19 | +INSERT INTO /*_*/updatelog (ul_key) VALUES ('fts3'); |
\ No newline at end of file |
Index: trunk/phase3/includes/installer/Installer.php |
— | — | @@ -8,14 +8,14 @@ |
9 | 9 | var $settings, $output; |
10 | 10 | |
11 | 11 | /** |
12 | | - * MediaWiki configuration globals that will eventually be passed through |
13 | | - * to LocalSettings.php. The names only are given here, the defaults |
| 12 | + * MediaWiki configuration globals that will eventually be passed through |
| 13 | + * to LocalSettings.php. The names only are given here, the defaults |
14 | 14 | * typically come from DefaultSettings.php. |
15 | 15 | */ |
16 | 16 | protected $defaultVarNames = array( |
17 | 17 | 'wgSitename', |
18 | 18 | 'wgPasswordSender', |
19 | | - 'wgLanguageCode', |
| 19 | + 'wgLanguageCode', |
20 | 20 | 'wgRightsIcon', |
21 | 21 | 'wgRightsText', |
22 | 22 | 'wgRightsUrl', |
— | — | @@ -41,8 +41,8 @@ |
42 | 42 | ); |
43 | 43 | |
44 | 44 | /** |
45 | | - * Variables that are stored alongside globals, and are used for any |
46 | | - * configuration of the installation process aside from the MediaWiki |
| 45 | + * Variables that are stored alongside globals, and are used for any |
| 46 | + * configuration of the installation process aside from the MediaWiki |
47 | 47 | * configuration. Map of names to defaults. |
48 | 48 | */ |
49 | 49 | protected $internalDefaults = array( |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | * Known database types. These correspond to the class names <type>Installer, |
79 | 79 | * and are also MediaWiki database types valid for $wgDBtype. |
80 | 80 | * |
81 | | - * To add a new type, create a <type>Installer class and a Database<type> |
| 81 | + * To add a new type, create a <type>Installer class and a Database<type> |
82 | 82 | * class, and add a config-type-<type> message to MessagesEn.php. |
83 | 83 | */ |
84 | 84 | private $dbTypes = array( |
— | — | @@ -98,8 +98,8 @@ |
99 | 99 | private $dbInstallers = array(); |
100 | 100 | |
101 | 101 | /** |
102 | | - * A list of environment check methods called by doEnvironmentChecks(). |
103 | | - * These may output warnings using showMessage(), and/or abort the |
| 102 | + * A list of environment check methods called by doEnvironmentChecks(). |
| 103 | + * These may output warnings using showMessage(), and/or abort the |
104 | 104 | * installation process by returning false. |
105 | 105 | */ |
106 | 106 | protected $envChecks = array( |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | '*' => array( 'edit' => false ) |
156 | 156 | ), |
157 | 157 | 'fishbowl' => array( |
158 | | - '*' => array( |
| 158 | + '*' => array( |
159 | 159 | 'createaccount' => false, |
160 | 160 | 'edit' => false, |
161 | 161 | ), |
— | — | @@ -199,7 +199,7 @@ |
200 | 200 | ), |
201 | 201 | 'cc-choose' => array( |
202 | 202 | // details will be filled in by the selector |
203 | | - 'url' => '', |
| 203 | + 'url' => '', |
204 | 204 | 'icon' => '', |
205 | 205 | 'text' => '', |
206 | 206 | ), |
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | /** |
259 | 259 | * UI interface for displaying a short message |
260 | 260 | * The parameters are like parameters to wfMsg(). |
261 | | - * The messages will be in wikitext format, which will be converted to an |
| 261 | + * The messages will be in wikitext format, which will be converted to an |
262 | 262 | * output format such as HTML or text before being sent to the user. |
263 | 263 | */ |
264 | 264 | abstract function showMessage( $msg /*, ... */ ); |
— | — | @@ -289,14 +289,14 @@ |
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
293 | | - * Do initial checks of the PHP environment. Set variables according to |
| 293 | + * Do initial checks of the PHP environment. Set variables according to |
294 | 294 | * the observed environment. |
295 | 295 | * |
296 | 296 | * It's possible that this may be called under the CLI SAPI, not the SAPI |
297 | 297 | * that the wiki will primarily run under. In that case, the subclass should |
298 | 298 | * initialise variables such as wgScriptPath, before calling this function. |
299 | 299 | * |
300 | | - * Under the web subclass, it can already be assumed that PHP 5+ is in use |
| 300 | + * Under the web subclass, it can already be assumed that PHP 5+ is in use |
301 | 301 | * and that sessions are working. |
302 | 302 | */ |
303 | 303 | function doEnvironmentChecks() { |
— | — | @@ -359,7 +359,7 @@ |
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
363 | | - * Set a variable which stores a password, except if the new value is a |
| 363 | + * Set a variable which stores a password, except if the new value is a |
364 | 364 | * fake password in which case leave it as it is. |
365 | 365 | */ |
366 | 366 | function setPassword( $name, $value ) { |
— | — | @@ -367,7 +367,7 @@ |
368 | 368 | $this->setVar( $name, $value ); |
369 | 369 | } |
370 | 370 | } |
371 | | - |
| 371 | + |
372 | 372 | /** Check if we're installing the latest version */ |
373 | 373 | function envLatestVersion() { |
374 | 374 | global $wgVersion; |
— | — | @@ -391,7 +391,7 @@ |
392 | 392 | } |
393 | 393 | if( version_compare( $wgVersion, $currentVersion, '<' ) ) { |
394 | 394 | $this->showMessage( 'config-env-latest-old' ); |
395 | | - $this->showHelpBox( 'config-env-latest-help', $wgVersion, $currentVersion ); |
| 395 | + $this->showHelpBox( 'config-env-latest-help', $wgVersion, $currentVersion ); |
396 | 396 | } elseif( version_compare( $wgVersion, $currentVersion, '>' ) ) { |
397 | 397 | $this->showMessage( 'config-env-latest-new' ); |
398 | 398 | } |
— | — | @@ -557,17 +557,17 @@ |
558 | 558 | } |
559 | 559 | |
560 | 560 | /** |
561 | | - * Search a path for any of the given executable names. Returns the |
562 | | - * executable name if found. Also checks the version string returned |
| 561 | + * Search a path for any of the given executable names. Returns the |
| 562 | + * executable name if found. Also checks the version string returned |
563 | 563 | * by each executable |
564 | 564 | * |
565 | 565 | * @param $path String: path to search |
566 | 566 | * @param $names Array of executable names |
567 | 567 | * @param $versionInfo Boolean false or array with two members: |
568 | | - * 0 => Command to run for version check, with $1 for the path |
569 | | - * 1 => String to compare the output with |
| 568 | + * 0 => Command to run for version check, with $1 for the path |
| 569 | + * 1 => String to compare the output with |
570 | 570 | * |
571 | | - * If $versionInfo is not false, only executables with a version |
| 571 | + * If $versionInfo is not false, only executables with a version |
572 | 572 | * matching $versionInfo[1] will be returned. |
573 | 573 | */ |
574 | 574 | function locateExecutable( $path, $names, $versionInfo = false ) { |
— | — | @@ -582,7 +582,7 @@ |
583 | 583 | |
584 | 584 | $file = str_replace( '$1', $command, $versionInfo[0] ); |
585 | 585 | # Should maybe be wfShellExec( $file), but runs into a ulimit, see |
586 | | - # http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=prev&oldid=335456 |
| 586 | + # http://www.mediawiki.org/w/index.php?title=New-installer_issues&diff=prev&oldid=335456 |
587 | 587 | if ( strstr( `$file`, $versionInfo[1]) !== false ) |
588 | 588 | return $command; |
589 | 589 | } |
— | — | @@ -732,7 +732,7 @@ |
733 | 733 | # Give up |
734 | 734 | return true; |
735 | 735 | } |
736 | | - |
| 736 | + |
737 | 737 | function envCheckUploadsDirectory() { |
738 | 738 | global $IP, $wgServer; |
739 | 739 | $dir = $IP . '/images/'; |
— | — | @@ -780,12 +780,12 @@ |
781 | 781 | * Convert wikitext $text to HTML. |
782 | 782 | * |
783 | 783 | * This is potentially error prone since many parser features require a complete |
784 | | - * installed MW database. The solution is to just not use those features when you |
| 784 | + * installed MW database. The solution is to just not use those features when you |
785 | 785 | * write your messages. This appears to work well enough. Basic formatting and |
786 | 786 | * external links work just fine. |
787 | 787 | * |
788 | | - * But in case a translator decides to throw in a #ifexist or internal link or |
789 | | - * whatever, this function is guarded to catch attempted DB access and to present |
| 788 | + * But in case a translator decides to throw in a #ifexist or internal link or |
| 789 | + * whatever, this function is guarded to catch attempted DB access and to present |
790 | 790 | * some fallback text. |
791 | 791 | * |
792 | 792 | * @param $text String |
— | — | @@ -819,8 +819,8 @@ |
820 | 820 | */ |
821 | 821 | function docLink( $linkText, $attribs, $parser ) { |
822 | 822 | $url = $this->getDocUrl( $attribs['href'] ); |
823 | | - return '<a href="' . htmlspecialchars( $url ) . '">' . |
824 | | - htmlspecialchars( $linkText ) . |
| 823 | + return '<a href="' . htmlspecialchars( $url ) . '">' . |
| 824 | + htmlspecialchars( $linkText ) . |
825 | 825 | '</a>'; |
826 | 826 | } |
827 | 827 | |
— | — | @@ -987,7 +987,7 @@ |
988 | 988 | wfSuppressWarnings(); |
989 | 989 | $ls = file_exists( "$IP/LocalSettings.php" ); |
990 | 990 | wfRestoreWarnings(); |
991 | | - |
| 991 | + |
992 | 992 | if( $ls ) { |
993 | 993 | if( $this->getDBInstaller()->needsUpgrade() ) { |
994 | 994 | $status->warning( 'config-localsettings-upgrade' ); |
— | — | @@ -1044,7 +1044,7 @@ |
1045 | 1045 | } |
1046 | 1046 | |
1047 | 1047 | /** |
1048 | | - * Add an installation step following the given step. |
| 1048 | + * Add an installation step following the given step. |
1049 | 1049 | * @param $findStep String the step to find. Use NULL to put the step at the beginning. |
1050 | 1050 | * @param $callback array |
1051 | 1051 | */ |
Index: trunk/phase3/includes/installer/CliInstaller.php |
— | — | @@ -47,9 +47,6 @@ |
48 | 48 | $this->setVar( 'wgSitename', $siteName ); |
49 | 49 | if ( $admin ) { |
50 | 50 | $this->setVar( '_AdminName', $admin ); |
51 | | - } else { |
52 | | - $this->setVar( '_AdminName', |
53 | | - wfMsgForContent( 'config-admin-default-username' ) ); |
54 | 51 | } |
55 | 52 | |
56 | 53 | if ( !isset( $option['installdbuser'] ) ) { |
— | — | @@ -67,26 +64,31 @@ |
68 | 65 | /** |
69 | 66 | * Main entry point. |
70 | 67 | */ |
71 | | - function execute( ) { |
72 | | - foreach( $this->getInstallSteps() as $stepObj ) { |
73 | | - $step = is_array( $stepObj ) ? $stepObj['name'] : $stepObj; |
74 | | - $this->showMessage( wfMsg( "config-install-$step") . |
75 | | - wfMsg( 'ellipsis' ) . wfMsg( 'word-separator' ) ); |
76 | | - $func = 'install' . ucfirst( $step ); |
77 | | - $status = $this->{$func}(); |
78 | | - $warnings = $status->getWarningsArray(); |
79 | | - if ( !$status->isOk() ) { |
80 | | - $this->showStatusMessage( $status ); |
81 | | - echo "\n"; |
82 | | - exit; |
83 | | - } elseif ( count($warnings) !== 0 ) { |
84 | | - foreach ( $status->getWikiTextArray( $warnings ) as $w ) { |
85 | | - $this->showMessage( $w . wfMsg( 'ellipsis') . |
86 | | - wfMsg( 'word-separator' ) ); |
87 | | - } |
| 68 | + public function execute( ) { |
| 69 | + $this->performInstallation( |
| 70 | + array( $this, 'startStage'), |
| 71 | + array( $this, 'endStage' ) |
| 72 | + ); |
| 73 | + } |
| 74 | + |
| 75 | + public function startStage( $step ) { |
| 76 | + $this->showMessage( wfMsg( "config-install-$step") . |
| 77 | + wfMsg( 'ellipsis' ) . wfMsg( 'word-separator' ) ); |
| 78 | + } |
| 79 | + |
| 80 | + public function endStage( $step, $status ) { |
| 81 | + $warnings = $status->getWarningsArray(); |
| 82 | + if ( !$status->isOk() ) { |
| 83 | + $this->showStatusMessage( $status ); |
| 84 | + echo "\n"; |
| 85 | + exit; |
| 86 | + } elseif ( count($warnings) !== 0 ) { |
| 87 | + foreach ( $status->getWikiTextArray( $warnings ) as $w ) { |
| 88 | + $this->showMessage( $w . wfMsg( 'ellipsis') . |
| 89 | + wfMsg( 'word-separator' ) ); |
88 | 90 | } |
89 | | - $this->showMessage( wfMsg( 'config-install-step-done' ) ."\n"); |
90 | 91 | } |
| 92 | + $this->showMessage( wfMsg( 'config-install-step-done' ) ."\n"); |
91 | 93 | } |
92 | 94 | |
93 | 95 | function showMessage( $msg /*, ... */ ) { |