Index: trunk/tools/mwmultiversion/multiversion/MWMultiVersion.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | */ |
29 | 29 | private static function createInstance() { |
30 | 30 | if ( isset( self::$instance ) ) { |
31 | | - die( "MWMultiVersion instance already set!" ); |
| 31 | + die( "MWMultiVersion instance already set!\n" ); |
32 | 32 | } |
33 | 33 | self::$instance = new self; |
34 | 34 | return self::$instance; |
— | — | @@ -88,7 +88,7 @@ |
89 | 89 | $matches = array(); |
90 | 90 | if ( $secure ) { |
91 | 91 | if ( !preg_match('/^([^.]+)\.([^.]+)\./', $secure, $matches ) ) { |
92 | | - die( "invalid hostname" ); |
| 92 | + die( "Invalid hostname.\n" ); |
93 | 93 | } |
94 | 94 | $lang = $matches[1]; |
95 | 95 | $site = $matches[2]; |
— | — | @@ -110,13 +110,13 @@ |
111 | 111 | } else if ( preg_match( '/^(.*)\.prototype\.wikimedia\.org$/', $serverName, $matches ) ) { |
112 | 112 | $lang = $matches[1]; |
113 | 113 | } else { |
114 | | - die( "Invalid host name ($serverName), can't determine language" ); |
| 114 | + die( "Invalid host name ($serverName), can't determine language.\n" ); |
115 | 115 | } |
116 | 116 | } elseif ( preg_match( "/^\/usr\/local\/apache\/(?:htdocs|common\/docroot)\/([a-z0-9\-_]*)$/", $docRoot, $matches ) ) { |
117 | 117 | $site = "wikipedia"; |
118 | 118 | $lang = $matches[1]; |
119 | 119 | } else { |
120 | | - die( "Invalid host name (docroot=" . $docRoot . "), can't determine language." ); |
| 120 | + die( "Invalid host name (docroot=" . $docRoot . "), can't determine language.\n" ); |
121 | 121 | } |
122 | 122 | } |
123 | 123 | $this->loadDBFromSite( $site, $lang ); |
— | — | @@ -130,7 +130,7 @@ |
131 | 131 | private function setSiteInfoForUploadWiki( $pathInfo ) { |
132 | 132 | $pathBits = explode( '/', $pathInfo ); |
133 | 133 | if ( count( $pathBits ) < 3 ) { |
134 | | - die( "Invalid file path info (pathinfo=" . $pathInfo . "), can't determine language." ); |
| 134 | + die( "Invalid file path info (pathinfo=" . $pathInfo . "), can't determine language.\n" ); |
135 | 135 | } |
136 | 136 | $site = $pathBits[1]; |
137 | 137 | $lang = $pathBits[2]; |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | $dbname = ''; |
150 | 150 | # The --wiki param must the second argument to to avoid |
151 | 151 | # any "options with args" ambiguity (see Maintenance.php). |
152 | | - if ( substr( $argv[1], 0, 7 ) === '--wiki=' ) { |
| 152 | + if ( isset( $argv[1] ) && substr( $argv[1], 0, 7 ) === '--wiki=' ) { |
153 | 153 | $dbname = substr( $argv[1], 7 ); |
154 | 154 | } elseif ( $argv[0] === 'addwiki.php' ) { |
155 | 155 | # Most scripts assume that the wiki already exists. addwiki.php is |
— | — | @@ -158,7 +158,7 @@ |
159 | 159 | } |
160 | 160 | |
161 | 161 | if ( $dbname === '' ) { |
162 | | - die( "--wiki must be the first parameter." ); |
| 162 | + die( "--wiki must be the first parameter.\n" ); |
163 | 163 | } |
164 | 164 | |
165 | 165 | $this->db = $dbname; |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | if ( $db ) { |
202 | 202 | $version = dba_fetch( $this->getDatabase(), $db ); |
203 | 203 | if ( strpos( $version, 'php-' ) !== 0 ) { |
204 | | - die( 'wikiversions.cdb entry should be of the format: php-...' ); |
| 204 | + die( "wikiversions.cdb entry should be of the format: php-...\n" ); |
205 | 205 | } |
206 | 206 | } else { |
207 | 207 | //trigger_error( "Unable to open /usr/local/apache/common/wikiversions.cdb. Assuming php-1.17", E_USER_ERROR ); |
Index: trunk/tools/mwmultiversion/multiversion/MWScript.php |
— | — | @@ -39,7 +39,7 @@ |
40 | 40 | } |
41 | 41 | |
42 | 42 | # MWScript.php should be in common/ |
43 | | - require_once( dirname( __FILE__ ) . '/../wmf-config/MWVersion.php' ); |
| 43 | + require_once( dirname( __FILE__ ) . '/MWVersion.php' ); |
44 | 44 | $file = getMediaWikiCli( $relFile ); |
45 | 45 | if ( !file_exists( $file ) ) { |
46 | 46 | die( "The MediaWiki script file \"{$file}\" does not exist.\n" ); |