Index: trunk/phase3/includes/installer/CliInstaller.php |
— | — | @@ -120,7 +120,11 @@ |
121 | 121 | } |
122 | 122 | |
123 | 123 | public function showMessage( $msg /*, ... */ ) { |
124 | | - echo html_entity_decode( strip_tags( $msg ), ENT_QUOTES ); |
| 124 | + $params = func_get_args(); |
| 125 | + array_shift( $params ); |
| 126 | + $text = wfMsgExt( $msg, array( 'parseinline' ), $params ); |
| 127 | + $text = preg_replace( '/<a href="(.*?)".*?>(.*?)<\/a>/', '$2 <$1>', $text ); |
| 128 | + echo html_entity_decode( strip_tags( $text ), ENT_QUOTES ) . "\n"; |
125 | 129 | flush(); |
126 | 130 | } |
127 | 131 | |
Index: trunk/phase3/maintenance/install.php |
— | — | @@ -52,18 +52,31 @@ |
53 | 53 | /* $this->addOption( 'dbschema', 'The schema for the MediaWiki DB in pg (mediawiki)', false, true ); */ |
54 | 54 | /* $this->addOption( 'dbtsearch2schema', 'The schema for the tsearch2 DB in pg (public)', false, true ); */ |
55 | 55 | /* $this->addOption( 'namespace', 'The project namespace (same as the name)', false, true ); */ |
| 56 | + $this->addOption( 'env-checks', "Run environment checks only, don't change anything" ); |
56 | 57 | } |
57 | 58 | |
58 | 59 | public function execute() { |
59 | | - global $IP; |
| 60 | + global $IP, $wgTitle; |
| 61 | + $siteName = isset( $this->mArgs[0] ) ? $this->mArgs[0] : "Don't care"; // Will not be set if used with --env-checks |
60 | 62 | $adminName = isset( $this->mArgs[1] ) ? $this->mArgs[1] : null; |
| 63 | + $wgTitle = Title::newFromText( 'Installer script' ); |
61 | 64 | |
62 | 65 | $installer = |
63 | | - new CliInstaller( $this->mArgs[0], $adminName, $this->mOptions ); |
| 66 | + new CliInstaller( $siteName, $adminName, $this->mOptions ); |
64 | 67 | |
65 | | - $installer->execute(); |
66 | | - $installer->writeConfigurationFile( $this->getOption( 'confpath', $IP ) ); |
| 68 | + if ( $this->hasOption( 'env-checks' ) ) { |
| 69 | + $installer->doEnvironmentChecks(); |
| 70 | + } else { |
| 71 | + $installer->execute(); |
| 72 | + $installer->writeConfigurationFile( $this->getOption( 'confpath', $IP ) ); |
| 73 | + } |
67 | 74 | } |
| 75 | + |
| 76 | + protected function validateParamsAndArgs() { |
| 77 | + if ( !$this->hasOption( 'env-checks' ) ) { |
| 78 | + parent::validateParamsAndArgs(); |
| 79 | + } |
| 80 | + } |
68 | 81 | } |
69 | 82 | |
70 | 83 | $maintClass = "CommandLineInstaller"; |