Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2773,8 +2773,8 @@ |
2774 | 2774 | * <code> |
2775 | 2775 | * $wgExtensionCredits[$type][] = array( |
2776 | 2776 | * 'name' => 'Example extension', |
2777 | | - * 'version' => 1.9, |
2778 | | - * 'path' => __FILE__, |
| 2777 | + * 'version' => 1.9, |
| 2778 | + * 'path' => __FILE__, |
2779 | 2779 | * 'author' => 'Foo Barstein', |
2780 | 2780 | * 'url' => 'http://wwww.example.com/Example%20Extension/', |
2781 | 2781 | * 'description' => 'An example extension', |
— | — | @@ -2783,8 +2783,6 @@ |
2784 | 2784 | * </code> |
2785 | 2785 | * |
2786 | 2786 | * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'. |
2787 | | - * Where 'descriptionmsg' can be an array with message key and parameters: |
2788 | | - * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ), |
2789 | 2787 | */ |
2790 | 2788 | $wgExtensionCredits = array(); |
2791 | 2789 | /* |
Index: trunk/phase3/includes/specials/SpecialVersion.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | private $firstExtOpened = true; |
15 | 15 | |
16 | 16 | function __construct(){ |
17 | | - parent::__construct( 'Version' ); |
| 17 | + parent::__construct( 'Version' ); |
18 | 18 | } |
19 | 19 | |
20 | 20 | /** |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | } else { |
33 | 33 | $wgOut->addHTML( '<div dir="ltr">' ); |
34 | 34 | } |
35 | | - $text = |
| 35 | + $text = |
36 | 36 | $this->MediaWikiCredits() . |
37 | 37 | $this->softwareInformation() . |
38 | 38 | $this->extensionCredits(); |
— | — | @@ -43,36 +43,6 @@ |
44 | 44 | $wgOut->addHTML( '</div>' ); |
45 | 45 | } |
46 | 46 | |
47 | | - /** |
48 | | - * check executive path existence |
49 | | - * @param string command |
50 | | - * @return mixed existsIn |
51 | | - */ |
52 | | - static function checkExecPath( $cmd ) { |
53 | | - $existsIn = false; |
54 | | - $pathDirArray = explode( ';' , $_SERVER['PATH'] ); |
55 | | - foreach ( $pathDirArray as $pathDir ) { |
56 | | - $pathDir = str_replace('\\', '/', $pathDir); |
57 | | - $pathDir .= '/'; |
58 | | - if ( ( file_exists ( $pathDir . '/' . $cmd ) ) || ( file_exists( trim( $pathDir . '/' . $cmd, '"' ) . '.exe' ) ) ) { |
59 | | - $existsIn = $pathDir; |
60 | | - } |
61 | | - } |
62 | | - return $existsIn; |
63 | | - } |
64 | | - |
65 | | - /** |
66 | | - * execuate command for output |
67 | | - * @param string command |
68 | | - * @return string output |
69 | | - */ |
70 | | - static function execOutput( $cmd ) { |
71 | | - $out = array( $cmd ); |
72 | | - exec( $cmd.' 2>&1', $out ); |
73 | | - unset($out[0]); |
74 | | - return implode("\n", $out ); |
75 | | - } |
76 | | - |
77 | 47 | /**#@+ |
78 | 48 | * @private |
79 | 49 | */ |
— | — | @@ -92,8 +62,7 @@ |
93 | 63 | copyright © 2001-2009 Magnus Manske, Brion Vibber, Lee Daniel Crocker, |
94 | 64 | Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason, |
95 | 65 | Niklas Laxström, Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor, |
96 | | - Aaron Schulz, Andrew Garrett, Raimond Spekking, Alexandre Emsenhuber, |
97 | | - Siebrand Mazeland, Chad Horohoe and others. |
| 66 | + Aaron Schulz and others. |
98 | 67 | |
99 | 68 | MediaWiki is free software; you can redistribute it and/or modify |
100 | 69 | it under the terms of the GNU General Public License as published by |
— | — | @@ -119,225 +88,16 @@ |
120 | 89 | * @return wiki text showing the third party software versions (apache, php, mysql). |
121 | 90 | */ |
122 | 91 | static function softwareInformation() { |
123 | | - global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgDiff3, $wgDiff, $wgUseTeX; |
124 | | - global $wgFileExtensions, $wgSVGConverter, $wgSVGConverters, $wgSVGConverterPath; |
125 | | - global $wgUser, $wgSpecialVersionExtended; |
126 | 92 | $dbr = wfGetDB( DB_SLAVE ); |
127 | 93 | |
128 | 94 | // Put the software in an array of form 'name' => 'version'. All messages should |
129 | 95 | // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup |
130 | 96 | // can be used |
131 | 97 | $software = array(); |
132 | | - |
133 | 98 | $software['[http://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); |
134 | 99 | $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")"; |
135 | 100 | $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion(); |
136 | 101 | |
137 | | - if( $wgSpecialVersionExtended || $wgUser->isAllowed( 'versiondetail' ) ) { |
138 | | - // Get the web server name and its version, if applicable |
139 | | - // Chop off PHP text from the string if it has the text desired |
140 | | - $serverSoftware = $_SERVER['SERVER_SOFTWARE']; |
141 | | - if ( strrpos( $serverSoftware, 'PHP' ) === false ) { |
142 | | - } else { |
143 | | - $serverSoftware = trim( substr( $serverSoftware, 0, strrpos($serverSoftware,'PHP') - 1 ) ); |
144 | | - } |
145 | | - |
146 | | - // Get the web server name and its version. |
147 | | - $serverSoftwareLine = explode('/',$serverSoftware); |
148 | | - $serverSoftwareName = $serverSoftwareLine[0]; |
149 | | - |
150 | | - // Insert the website of the web server if applicable. |
151 | | - if ( stristr( $serverSoftwareName, 'Apache' ) ) |
152 | | - $serverSoftwareURL = 'http://httpd.apache.org/'; |
153 | | - else if ( stristr( $serverSoftwareName, 'IIS' ) ) |
154 | | - $serverSoftwareURL = 'http://www.microsoft.com/iis/'; |
155 | | - else if ( stristr( $serverSoftwareName, 'Cherokee' ) ) |
156 | | - $serverSoftwareURL = 'http://www.cherokee-project.com/'; |
157 | | - else if ( stristr( $serverSoftwareName, 'lighttpd' ) ) |
158 | | - $serverSoftwareURL = 'http://www.lighttpd.net/'; |
159 | | - else if ( stristr( $serverSoftwareName, 'Sun' ) ) |
160 | | - $serverSoftwareURL = 'http://www.sun.com/software/products/web_srvr/'; |
161 | | - else if ( stristr( $serverSoftwareName, 'nginx' ) ) |
162 | | - $serverSoftwareURL = 'http://nginx.net/'; |
163 | | - |
164 | | - // Get the version of the web server. If does not have one, |
165 | | - // leave it as empty. |
166 | | - if ( $serverSoftwareLine[1] != '' ) { |
167 | | - $serverSoftwareVersion = $serverSoftwareLine[1]; |
168 | | - } else { |
169 | | - $serverSoftwareVersion = ''; |
170 | | - } |
171 | | - |
172 | | - if ( isset( $serverSoftwareURL ) ) |
173 | | - $software["[$serverSoftwareURL $serverSoftwareName]"] = $serverSoftwareVersion; |
174 | | - else |
175 | | - $software[$serverSoftwareName] = $serverSoftwareVersion; |
176 | | - |
177 | | - // Version information for diff3 |
178 | | - if ( file_exists( trim( $wgDiff3, '"' ) ) ) { |
179 | | - $swDiff3Info = self::execOutput( $wgDiff3 . ' -v' ); |
180 | | - $swDiff3Line = explode("\n",$swDiff3Info ,2); |
181 | | - $swDiff3Ver = $swDiff3Line[0]; |
182 | | - $swDiff3Ver = str_replace( 'diff3 (GNU diffutils) ', '' , $swDiff3Ver); |
183 | | - $software['[http://www.gnu.org/software/diffutils/diffutils.html diff3]'] = $swDiff3Ver; |
184 | | - } |
185 | | - |
186 | | - // Version information for diff |
187 | | - if ( file_exists( trim( $wgDiff, '"' ) ) ) { |
188 | | - $swDiffInfo = self::execOutput( $wgDiff . ' -v' ); |
189 | | - $swDiffLine = explode("\n",$swDiffInfo ,2); |
190 | | - $swDiffVer = $swDiffLine[0]; |
191 | | - $swDiffVer = str_replace( 'diff (GNU diffutils) ', '' , $swDiffVer); |
192 | | - $software['[http://www.gnu.org/software/diffutils/diffutils.html diff]'] = $swDiffVer; |
193 | | - } |
194 | | - |
195 | | - // Look for ImageMagick's version, if did not found, try to find the GD library version |
196 | | - if ( $wgUseImageMagick ) { |
197 | | - if ( file_exists( trim( $wgImageMagickConvertCommand, '"' ) ) ) { |
198 | | - $swImageMagickInfo = self::execOutput( $wgImageMagickConvertCommand . ' -version' ); |
199 | | - list( $head, $tail ) = explode( 'ImageMagick', $swImageMagickInfo ); |
200 | | - list( $swImageMagickVer ) = explode('http://www.imagemagick.org', $tail ); |
201 | | - $software['[http://www.imagemagick.org/ ImageMagick]'] = $swImageMagickVer; |
202 | | - } |
203 | | - } else { |
204 | | - if( function_exists( 'gd_info' ) ) { |
205 | | - $gdInfo = gd_info(); |
206 | | - if ( strstr( $gdInfo['GD Version'], 'bundled' ) != false ) { |
207 | | - $gd_URL = 'http://www.php.net/gd'; |
208 | | - } else { |
209 | | - $gd_URL = 'http://www.libgd.org'; |
210 | | - } |
211 | | - $software['[' . $gd_URL . ' GD library]'] = $gdInfo['GD Version']; |
212 | | - } |
213 | | - } |
214 | | - |
215 | | - // Look for SVG converter and print the version info |
216 | | - if ( in_array( 'svg', $wgFileExtensions ) ) { |
217 | | - $swSVGConvName = $wgSVGConverter; |
218 | | - $swSVGConvInfo = ''; |
219 | | - $haveSVGConvVer = false; |
220 | | - $pathVar = '$path/'; |
221 | | - $binPath = '/usr/bin/'; |
222 | | - $execPath = strtok(strstr($wgSVGConverters[$wgSVGConverter],$pathVar), ' '); |
223 | | - $execPath = substr_replace($execPath, '', 0, strlen($pathVar)); |
224 | | - $execFullPath = trim($wgSVGConverterPath,'"') . $execPath; |
225 | | - $execBinPath = $binPath . $execPath; |
226 | | - $execPathVal = self::checkExecPath( $execPath ); |
227 | | - if (strstr($execFullPath, ' ') != false) { |
228 | | - $execFullPath = '"' . $execFullPath . '"'; |
229 | | - } |
230 | | - if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) { |
231 | | - // Get version info for ImageMagick |
232 | | - if ( file_exists( $execBinPath ) ) |
233 | | - $swSVGConvInfo = self::execOutput( $execBinPath . ' -version' ); |
234 | | - else if ( file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) |
235 | | - $swSVGConvInfo = self::execOutput( $execFullPath . ' -version' ); |
236 | | - else if ( $execPathVal != false ) |
237 | | - $swSVGConvInfo = self::execOutput( $execPathVal . $execPath . ' -version' ); |
238 | | - list( $head, $tail ) = explode( 'ImageMagick', $swSVGConvInfo ); |
239 | | - list( $swSVGConvVer ) = explode('http://www.imagemagick.org', $tail ); |
240 | | - $swSVGConvURL = 'http://www.imagemagick.org/'; |
241 | | - $haveSVGConvVer = true; |
242 | | - } else if ( strstr ($execFullPath, 'rsvg') != false ) { |
243 | | - // Get version info for rsvg |
244 | | - if ( file_exists( $execBinPath ) ) |
245 | | - $swSVGConvInfo = self::execOutput( $execBinPath . ' -v' ); |
246 | | - else if ( file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) |
247 | | - $swSVGConvInfo = self::execOutput( $execFullPath . ' -v' ); |
248 | | - else if ( $execPathVal != false ) |
249 | | - $swSVGConvInfo = self::execOutput( $execPathVal . $execPath . ' -v' ); |
250 | | - $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); |
251 | | - $swSVGConvVer = $swSVGConvLine[0]; |
252 | | - $swSVGConvURL = 'http://librsvg.sourceforge.net/'; |
253 | | - $haveSVGConvVer = true; |
254 | | - } else if ( strstr ($execFullPath, 'inkscape') != false ) { |
255 | | - // Get version info for Inkscape |
256 | | - if ( file_exists( $execBinPath ) ) |
257 | | - $swSVGConvInfo = self::execOutput( $execBinPath . ' -z -V' ); |
258 | | - else if ( file_exists( trim( $execFullPath, '"' ) ) || ( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) ) |
259 | | - $swSVGConvInfo = self::execOutput( $execFullPath . ' -z -V' ); |
260 | | - else if ( $execPathVal != false ) |
261 | | - $swSVGConvInfo = self::execOutput( $execPathVal . $execPath . ' -z -V' ); |
262 | | - $swSVGConvLine = explode("\n",$swSVGConvInfo ,2); |
263 | | - $swSVGConvVer = ltrim( $swSVGConvLine[0], 'Inkscape ' ); |
264 | | - $swSVGConvURL = 'http://www.inkscape.org/'; |
265 | | - $swSVGConvName = ucfirst( $wgSVGConverter ); |
266 | | - $haveSVGConvVer = true; |
267 | | - } |
268 | | - if ( $haveSVGConvVer ) |
269 | | - $software["[$swSVGConvURL $swSVGConvName]"] = $swSVGConvVer; |
270 | | - } |
271 | | - |
272 | | - // Look for TeX support and print the software version info |
273 | | - if ( $wgUseTeX ) { |
274 | | - $binPath = '/usr/bin/'; |
275 | | - $swMathName = Array( |
276 | | - 'ocaml' => 'OCaml', |
277 | | - 'gs' => 'Ghostscript', |
278 | | - 'dvips' => 'Dvips', |
279 | | - 'latex' => 'LaTeX', |
280 | | - 'imagemagick' => 'ImageMagick', |
281 | | - ); |
282 | | - $swMathURL = Array( |
283 | | - 'ocaml' => 'http://caml.inria.fr/', |
284 | | - 'gs' => 'http://www.ghostscript.com/', |
285 | | - 'dvips' => 'http://www.radicaleye.com/dvips.html', |
286 | | - 'latex' => 'http://www.latex-project.org/', |
287 | | - 'imagemagick' => 'http://www.imagemagick.org/', |
288 | | - ); |
289 | | - $swMathExec = Array( |
290 | | - 'ocaml' => 'ocamlc', |
291 | | - 'gs' => 'gs', |
292 | | - 'dvips' => 'dvips', |
293 | | - 'latex' => 'latex', |
294 | | - 'imagemagick' => 'convert', |
295 | | - ); |
296 | | - $swMathParam = Array( |
297 | | - 'ocaml' => '-version', |
298 | | - 'gs' => '-v', |
299 | | - 'dvips' => '-v', |
300 | | - 'latex' => '-v', |
301 | | - 'imagemagick' => '-version', |
302 | | - ); |
303 | | - foreach ( $swMathExec as $swMath => $swMathCmd ) { |
304 | | - $wBinPath = ''; |
305 | | - if ( file_exists( $binPath . 'whereis' ) ) { |
306 | | - $swWhereIsInfo = self::execOutput( $binPath . 'whereis -b ' . $swMathCmd ); |
307 | | - $swWhereIsLine = explode( "\n", $swWhereIsInfo, 2); |
308 | | - $swWhereIsFirstLine = $swWhereIsLine[0]; |
309 | | - $swWhereIsBinPath = explode( ' ', $swWhereIsFirstLine, 3); |
310 | | - if ( count( $swWhereIsBinPath ) > 1 ) |
311 | | - $wBinPath = dirname( $swWhereIsBinPath[1] ); |
312 | | - } else { |
313 | | - $swPathLine = explode( ';', $_SERVER['PATH'] ); |
314 | | - $swPathFound = false; |
315 | | - foreach( $swPathLine as $swPathDir ) { |
316 | | - if ( file_exists( $swPathDir . '/' . $swMathCmd . '.exe' ) && ($swPathFound === false) ) { |
317 | | - $wBinPath = $swPathDir . '/'; |
318 | | - $swPathFound = true; |
319 | | - } |
320 | | - } |
321 | | - } |
322 | | - if ( file_exists( $binPath . $swMathCmd ) || file_exists( $wBinPath . $swMathCmd ) ) { |
323 | | - $swMathInfo = self::execOutput( $swMathCmd . ' ' . $swMathParam[$swMath] ); |
324 | | - $swMathLine = explode( "\n", $swMathInfo, 2); |
325 | | - $swMathVerInfo = $swMathLine[0]; |
326 | | - if ( !strcmp( $swMath, 'gs' ) ) |
327 | | - $swMathVerInfo = str_replace( 'GPL Ghostscript ', '', $swMathVerInfo ); |
328 | | - else if ( !strcmp( $swMath, 'dvips' ) ) { |
329 | | - $swMathVerParts = explode( ' ' , $swMathVerInfo ); |
330 | | - $swMathVerInfo = $swMathVerParts[3]; |
331 | | - } else if ( !strcmp( $swMath, 'imagemagick' ) ) { |
332 | | - list( $head, $tail ) = explode( 'ImageMagick', $swMathVerInfo ); |
333 | | - list( $swMathVerInfo ) = explode('http://www.imagemagick.org', $tail ); |
334 | | - } |
335 | | - $swMathVer[$swMath] = trim( $swMathVerInfo ); |
336 | | - $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = $swMathVer[$swMath]; |
337 | | - } |
338 | | - } |
339 | | - } |
340 | | - } |
341 | | - |
342 | 102 | // Allow a hook to add/remove items |
343 | 103 | wfRunHooks( 'SoftwareInfo', array( &$software ) ); |
344 | 104 | |
— | — | @@ -352,7 +112,7 @@ |
353 | 113 | <td>" . $name . "</td> |
354 | 114 | <td>" . $version . "</td> |
355 | 115 | </tr>\n"; |
356 | | - } |
| 116 | + } |
357 | 117 | return $out . Xml::closeElement( 'table' ); |
358 | 118 | } |
359 | 119 | |
— | — | @@ -376,7 +136,7 @@ |
377 | 137 | wfProfileOut( __METHOD__ ); |
378 | 138 | return $version; |
379 | 139 | } |
380 | | - |
| 140 | + |
381 | 141 | /** |
382 | 142 | * Return a string of the MediaWiki version with a link to SVN revision if |
383 | 143 | * available |
— | — | @@ -447,7 +207,7 @@ |
448 | 208 | isset ( $extension['author'] ) ? $extension['author'] : '', |
449 | 209 | isset ( $extension['url'] ) ? $extension['url'] : null, |
450 | 210 | isset ( $extension['description'] ) ? $extension['description'] : '', |
451 | | - isset ( $extension['descriptionmsg'] ) ? $extension['descriptionmsg'] : null |
| 211 | + isset ( $extension['descriptionmsg'] ) ? $extension['descriptionmsg'] : '' |
452 | 212 | ); |
453 | 213 | } |
454 | 214 | } |
— | — | @@ -493,20 +253,13 @@ |
494 | 254 | function formatCredits( $name, $version = null, $subVersion = null, $subVersionCo = null, $subVersionURL = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) { |
495 | 255 | $haveSubversion = $subVersion; |
496 | 256 | $extension = isset( $url ) ? "[$url $name]" : $name; |
497 | | - $version = isset( $version ) ? '<span class="mw-version-ext-version">' . wfMsg( 'version-version', $version ) . '</span>' : ''; |
| 257 | + $version = isset( $version ) ? wfMsg( 'version-version', $version ) : ''; |
498 | 258 | $subVersion = isset( $subVersion ) ? wfMsg( 'version-svn-revision', $subVersion, $subVersionCo ) : ''; |
499 | 259 | $subVersion = isset( $subVersionURL ) ? "[$subVersionURL $subVersion]" : $subVersion; |
500 | 260 | |
501 | 261 | # Look for a localized description |
502 | 262 | if( isset( $descriptionMsg ) ) { |
503 | | - if( is_array( $descriptionMsg ) ) { |
504 | | - $descriptionMsgKey = $descriptionMsg[0]; // Get the message key |
505 | | - array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only |
506 | | - array_map( "htmlspecialchars", $descriptionMsg ); // For sanity |
507 | | - $msg = wfMsg( $descriptionMsgKey, $descriptionMsg ); |
508 | | - } else { |
509 | | - $msg = wfMsg( $descriptionMsg ); |
510 | | - } |
| 263 | + $msg = wfMsg( $descriptionMsg ); |
511 | 264 | if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) { |
512 | 265 | $description = $msg; |
513 | 266 | } |
— | — | @@ -616,7 +369,7 @@ |
617 | 370 | } else { |
618 | 371 | if( is_object( $list[0] ) ) |
619 | 372 | $class = get_class( $list[0] ); |
620 | | - else |
| 373 | + else |
621 | 374 | $class = $list[0]; |
622 | 375 | return "($class, {$list[1]})"; |
623 | 376 | } |
— | — | @@ -631,7 +384,7 @@ |
632 | 385 | * @param Boolean $extension optional to check the path whether is from |
633 | 386 | * Wikimedia SVN server or not |
634 | 387 | * @param Boolean $relPath optional to get the end part of the checkout path |
635 | | - * @return mixed revision number as int, end part of the checkout path, |
| 388 | + * @return mixed revision number as int, end part of the checkout path, |
636 | 389 | * or false if not a SVN checkout |
637 | 390 | */ |
638 | 391 | public static function getSvnRevision( $dir, $coRev = false, $extension = false, $relPath = false) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -131,9 +131,6 @@ |
132 | 132 | stripped from them. |
133 | 133 | * Added a PHP port of CDB (constant database), for improved local caching when |
134 | 134 | the DBA extension is not available. |
135 | | -* (bug 14611) Added support showing the version of the web server, image |
136 | | - thumbnailing engine, diff/diff3 engine and TeX engine, enabled for sysops |
137 | | - by default. |
138 | 135 | * Introduced a new system for localisation caching. The system is based around |
139 | 136 | fast fetches of individual messages, minimising memory overhead and startup |
140 | 137 | time in the typical case. The database backend will be used by default, but |
— | — | @@ -176,7 +173,6 @@ |
177 | 174 | extension version in Special:Version |
178 | 175 | * (bug 20014) Added CSS class "mw-listgrouprights-right-name" is wrapped on the |
179 | 176 | right name in Special:ListGroupRights |
180 | | -* The description message in $wgExtensionCredits can be an array with parameters |
181 | 177 | * (bug 12920) New CoreParserFunction {{nse:...}} as an url-friendly equivalent |
182 | 178 | to {{ns:...}} |
183 | 179 | * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params |