Index: trunk/phase3/includes/installer/CliInstaller.php |
— | — | @@ -6,6 +6,7 @@ |
7 | 7 | * @since 1.17 |
8 | 8 | */ |
9 | 9 | class CliInstaller extends CoreInstaller { |
| 10 | + |
10 | 11 | private $optionMap = array( |
11 | 12 | 'dbtype' => 'wgDBtype', |
12 | 13 | 'dbserver' => 'wgDBserver', |
— | — | @@ -25,8 +26,14 @@ |
26 | 27 | 'dbpath' => 'wgSQLiteDataDir', |
27 | 28 | ); |
28 | 29 | |
29 | | - /** Constructor */ |
30 | | - function __construct( $siteName, $admin = null, $option = array() ) { |
| 30 | + /** |
| 31 | + * Constructor. |
| 32 | + * |
| 33 | + * @param $siteName |
| 34 | + * @param $admin |
| 35 | + * @param $option Array |
| 36 | + */ |
| 37 | + function __construct( $siteName, $admin = null, array $option = array() ) { |
31 | 38 | parent::__construct(); |
32 | 39 | |
33 | 40 | foreach ( $this->optionMap as $opt => $global ) { |
— | — | @@ -45,6 +52,7 @@ |
46 | 53 | } |
47 | 54 | |
48 | 55 | $this->setVar( 'wgSitename', $siteName ); |
| 56 | + |
49 | 57 | if ( $admin ) { |
50 | 58 | $this->setVar( '_AdminName', $admin ); |
51 | 59 | } |
— | — | @@ -66,28 +74,30 @@ |
67 | 75 | */ |
68 | 76 | public function execute() { |
69 | 77 | $this->performInstallation( |
70 | | - array( $this, 'startStage'), |
| 78 | + array( $this, 'startStage' ), |
71 | 79 | array( $this, 'endStage' ) |
72 | 80 | ); |
73 | 81 | } |
74 | 82 | |
75 | 83 | public function startStage( $step ) { |
76 | | - $this->showMessage( wfMsg( "config-install-$step") . |
| 84 | + $this->showMessage( wfMsg( "config-install-$step" ) . |
77 | 85 | wfMsg( 'ellipsis' ) . wfMsg( 'word-separator' ) ); |
78 | 86 | } |
79 | 87 | |
80 | 88 | public function endStage( $step, $status ) { |
81 | 89 | $warnings = $status->getWarningsArray(); |
| 90 | + |
82 | 91 | if ( !$status->isOk() ) { |
83 | 92 | $this->showStatusMessage( $status ); |
84 | 93 | echo "\n"; |
85 | 94 | exit; |
86 | 95 | } elseif ( count($warnings) !== 0 ) { |
87 | 96 | foreach ( $status->getWikiTextArray( $warnings ) as $w ) { |
88 | | - $this->showMessage( $w . wfMsg( 'ellipsis') . |
| 97 | + $this->showMessage( $w . wfMsg( 'ellipsis' ) . |
89 | 98 | wfMsg( 'word-separator' ) ); |
90 | 99 | } |
91 | 100 | } |
| 101 | + |
92 | 102 | $this->showMessage( wfMsg( 'config-install-step-done' ) ."\n"); |
93 | 103 | } |
94 | 104 | |