4 * Give information about the version of MediaWiki, PHP, the DB and extensions
8 * @author Ævar Arnfjörð Bjarmason <avarab@gmail.com>
9 * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason
10 * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
12 class SpecialVersion
extends SpecialPage
{
13 private $firstExtOpened = true;
15 function __construct(){
16 parent
::__construct( 'Version' );
22 function execute( $par ) {
23 global $wgOut, $wgMessageCache, $wgSpecialVersionShowHooks, $wgContLang;
24 $wgMessageCache->loadAllMessages();
27 $this->outputHeader();
29 if( $wgContLang->isRTL() ) {
30 $wgOut->addHTML( '<div dir="rtl">' );
32 $wgOut->addHTML( '<div dir="ltr">' );
35 $this->MediaWikiCredits() .
36 $this->softwareInformation() .
37 $this->extensionCredits();
38 if ( $wgSpecialVersionShowHooks ) {
39 $text .= $this->wgHooks();
41 $wgOut->addWikiText( $text );
42 $wgOut->addHTML( $this->IPInfo() );
43 $wgOut->addHTML( '</div>' );
47 * execuate command for output
48 * @param string command
49 * @return string output
51 static function execOutput( $cmd ) {
53 exec( $cmd.' 2>&1', $out );
55 return implode("\n", $out );
63 * @return wiki text showing the license information
65 static function MediaWikiCredits() {
68 $ret = Xml
::element( 'h2', array( 'id' => 'mw-version-license' ), wfMsg( 'version-license' ) );
70 // This text is always left-to-right.
71 $ret .= '<div dir="ltr">';
73 This wiki is powered by '''[http://www.mediawiki.org/ MediaWiki]''',
74 copyright © 2001-2009 Magnus Manske, Brion Vibber, Lee Daniel Crocker,
75 Tim Starling, Erik Möller, Gabriel Wicke, Ævar Arnfjörð Bjarmason,
76 Niklas Laxström, Domas Mituzas, Rob Church, Yuri Astrakhan, Aryeh Gregor,
77 Aaron Schulz, Andrew Garrett and others.
79 MediaWiki is free software; you can redistribute it and/or modify
80 it under the terms of the GNU General Public License as published by
81 the Free Software Foundation; either version 2 of the License, or
82 (at your option) any later version.
84 MediaWiki is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
87 GNU General Public License for more details.
89 You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU General Public License]
90 along with this program; if not, write to the Free Software
91 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
92 or [http://www.gnu.org/licenses/old-licenses/gpl-2.0.html read it online].
96 return str_replace( "\t\t", '', $ret ) . "\n";
100 * @return wiki text showing the third party software versions (apache, php, mysql).
102 static function softwareInformation() {
103 global $wgUseImageMagick, $wgImageMagickConvertCommand, $wgDiff3, $wgDiff, $wgUseTeX;
104 global $wgAllowTitlesInSVG, $wgSVGConverter, $wgSVGConverters, $wgSVGConverterPath;
105 global $wgUser, $wgSpecialVersionExtended;
106 $dbr = wfGetDB( DB_SLAVE
);
108 // Put the software in an array of form 'name' => 'version'. All messages should
109 // be loaded here, so feel free to use wfMsg*() in the 'name'. Raw HTML or wikimarkup
113 $software['[http://www.mediawiki.org/ MediaWiki]'] = self
::getVersionLinked();
114 $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . php_sapi_name() . ")";
115 $software[$dbr->getSoftwareLink()] = $dbr->getServerVersion();
117 if( $wgSpecialVersionExtended ||
$wgUser->isAllowed( 'versiondetail' ) ) {
118 // Get the web server name and its version, if applicable
119 // Chop off PHP text from the string if it has the text desired
120 $serverSoftware = $_SERVER['SERVER_SOFTWARE'];
121 if ( strrpos( $serverSoftware, 'PHP' ) === false ) {
123 $serverSoftware = trim( substr( $serverSoftware, 0, strrpos($serverSoftware,'PHP') - 1 ) );
126 // Get the web server name and its version.
127 $serverSoftwareLine = explode('/',$serverSoftware);
128 $serverSoftwareName = $serverSoftwareLine[0];
130 // Insert the website of the web server if applicable.
131 if ( stristr( $serverSoftwareName, 'Apache' ) )
132 $serverSoftwareURL = 'http://httpd.apache.org/';
133 else if ( stristr( $serverSoftwareName, 'IIS' ) )
134 $serverSoftwareURL = 'http://www.microsoft.com/iis/';
135 else if ( stristr( $serverSoftwareName, 'Cherokee' ) )
136 $serverSoftwareURL = 'http://www.cherokee-project.com/';
137 else if ( stristr( $serverSoftwareName, 'lighttpd' ) )
138 $serverSoftwareURL = 'http://www.lighttpd.net/';
139 else if ( stristr( $serverSoftwareName, 'Sun' ) )
140 $serverSoftwareURL = 'http://www.sun.com/software/products/web_srvr/';
141 else if ( stristr( $serverSoftwareName, 'nginx' ) )
142 $serverSoftwareURL = 'http://nginx.net/';
144 // Get the version of the web server. If does not have one,
145 // leave it as empty.
146 if ( $serverSoftwareLine[1] != '' ) {
147 $serverSoftwareVersion = $serverSoftwareLine[1];
149 $serverSoftwareVersion = '';
152 if ( isset( $serverSoftwareURL ) )
153 $software["[$serverSoftwareURL $serverSoftwareName]"] = $serverSoftwareVersion;
155 $software[$serverSoftwareName] = $serverSoftwareVersion;
157 // Version information for diff3
158 if ( file_exists( trim( $wgDiff3, '"' ) ) ) {
159 $swDiff3Info = self
::execOutput( $wgDiff3 . ' -v' );
160 $swDiff3Line = explode("\n",$swDiff3Info ,2);
161 $swDiff3Ver = $swDiff3Line[0];
162 $swDiff3Ver = str_replace( 'diff3 (GNU diffutils) ', '' , $swDiff3Ver);
163 $software['[http://www.gnu.org/software/diffutils/diffutils.html diff3]'] = $swDiff3Ver;
166 // Version information for diff
167 if ( file_exists( trim( $wgDiff, '"' ) ) ) {
168 $swDiffInfo = self
::execOutput( $wgDiff . ' -v' );
169 $swDiffLine = explode("\n",$swDiffInfo ,2);
170 $swDiffVer = $swDiffLine[0];
171 $swDiffVer = str_replace( 'diff (GNU diffutils) ', '' , $swDiffVer);
172 $software['[http://www.gnu.org/software/diffutils/diffutils.html diff]'] = $swDiffVer;
175 // Look for ImageMagick's version, if did not found, try to find the GD library version
176 if ( $wgUseImageMagick ) {
177 if ( file_exists( trim( $wgImageMagickConvertCommand, '"' ) ) ) {
178 $swImageMagickInfo = self
::execOutput( $wgImageMagickConvertCommand . ' -version' );
179 list( $head, $tail ) = explode( 'ImageMagick', $swImageMagickInfo );
180 list( $swImageMagickVer ) = explode('http://www.imagemagick.org', $tail );
181 $software['[http://www.imagemagick.org/ ImageMagick]'] = $swImageMagickVer;
184 if( function_exists( 'gd_info' ) ) {
186 if ( strstr( $gdInfo['GD Version'], 'bundled' ) != false ) {
187 $gd_URL = 'http://www.php.net/gd';
189 $gd_URL = 'http://www.libgd.org';
191 $software['[' . $gd_URL . ' GD library]'] = $gdInfo['GD Version'];
195 // Look for SVG converter and print the version info
196 if ( $wgAllowTitlesInSVG ) {
197 $swSVGConvName = $wgSVGConverter;
198 $haveSVGConvVer = false;
200 $binPath = '/usr/bin/';
201 $execPath = strtok(strstr($wgSVGConverters[$wgSVGConverter],$pathVar), ' ');
202 $execPath = substr_replace($execPath, '', 0, strlen($pathVar));
203 $execFullPath = trim($wgSVGConverterPath,'"') . $execPath;
204 $execBinPath = $binPath . $execPath;
205 if (strstr($execFullPath, ' ') != false) {
206 $execFullPath = '"' . $execFullPath . '"';
208 if ( !strcmp( $wgSVGConverter, 'ImageMagick') ) {
209 // Get version info for ImageMagick
210 if ( file_exists( $execBinPath ) )
211 $swSVGConvInfo = self
::execOutput( $execBinPath . ' -version' );
212 else if ( file_exists( trim( $execFullPath, '"' ) ) ||
( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
213 $swSVGConvInfo = self
::execOutput( $execFullPath . ' -version' );
214 list( $head, $tail ) = explode( 'ImageMagick', $swSVGConvInfo );
215 list( $swSVGConvVer ) = explode('http://www.imagemagick.org', $tail );
216 $swSVGConvURL = 'http://www.imagemagick.org/';
217 $haveSVGConvVer = true;
218 } else if ( strstr ($execFullPath, 'rsvg') != false ) {
219 // Get version info for rsvg
220 if ( file_exists( $execBinPath ) )
221 $swSVGConvInfo = self
::execOutput( $execBinPath . ' -v' );
222 else if ( file_exists( trim( $execFullPath, '"' ) ) ||
( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
223 $swSVGConvInfo = self
::execOutput( $execFullPath . ' -v' );
224 $swSVGConvLine = explode("\n",$swSVGConvInfo ,2);
225 $swSVGConvVer = $swSVGConvLine[0];
226 $swSVGConvURL = 'http://librsvg.sourceforge.net/';
227 $haveSVGConvVer = true;
228 } else if ( strstr ($execFullPath, 'inkscape') != false ) {
229 // Get version info for Inkscape
230 if ( file_exists( $execBinPath ) )
231 $swSVGConvInfo = self
::execOutput( $execBinPath . ' -z -V' );
232 else if ( file_exists( trim( $execFullPath, '"' ) ) ||
( file_exists( trim( $execFullPath, '"' ) . '.exe' ) ) )
233 $swSVGConvInfo = self
::execOutput( $execFullPath . ' -z -V' );
234 $swSVGConvLine = explode("\n",$swSVGConvInfo ,2);
235 $swSVGConvVer = ltrim( $swSVGConvLine[0], 'Inkscape ' );
236 $swSVGConvURL = 'http://www.inkscape.org/';
237 $swSVGConvName = ucfirst( $wgSVGConverter );
238 $haveSVGConvVer = true;
240 if ( $haveSVGConvVer )
241 $software["[$swSVGConvURL $swSVGConvName]"] = $swSVGConvVer;
244 // Look for TeX support and print the software version info
246 $binPath = '/usr/bin/';
249 'gs' => 'Ghostscript',
252 'imagemagick' => 'ImageMagick',
255 'ocaml' => 'http://caml.inria.fr/',
256 'gs' => 'http://www.ghostscript.com/',
257 'dvips' => 'http://www.radicaleye.com/dvips.html',
258 'latex' => 'http://www.latex-project.org/',
259 'imagemagick' => 'http://www.imagemagick.org/',
266 'imagemagick' => 'convert',
268 $swMathParam = Array(
269 'ocaml' => '-version',
273 'imagemagick' => '-version',
275 foreach ( $swMathExec as $swMath => $swMathCmd ) {
277 if ( file_exists( $binPath . 'whereis' ) ) {
278 $swWhereIsInfo = self
::execOutput( $binPath . 'whereis -b ' . $swMathCmd );
279 $swWhereIsLine = explode( "\n", $swWhereIsInfo, 2);
280 $swWhereIsFirstLine = $swWhereIsLine[0];
281 $swWhereIsBinPath = explode( ' ', $swWhereIsFirstLine, 3);
282 if ( count( $swWhereIsBinPath ) > 1 )
283 $wBinPath = dirname( $swWhereIsBinPath[1] );
285 $swPathLine = explode( ';', $_SERVER['PATH'] );
286 $swPathFound = false;
287 foreach( $swPathLine as $swPathDir ) {
288 if ( file_exists( $swPathDir . '/' . $swMathCmd . '.exe' ) && ($swPathFound === false) ) {
289 $wBinPath = $swPathDir . '/';
294 if ( file_exists( $binPath . $swMathCmd ) ||
file_exists( $wBinPath . $swMathCmd ) ) {
295 $swMathInfo = self
::execOutput( $swMathCmd . ' ' . $swMathParam[$swMath] );
296 $swMathLine = explode( "\n", $swMathInfo, 2);
297 $swMathVerInfo = $swMathLine[0];
298 if ( !strcmp( $swMath, 'gs' ) )
299 $swMathVerInfo = str_replace( 'GPL Ghostscript ', '', $swMathVerInfo );
300 else if ( !strcmp( $swMath, 'dvips' ) ) {
301 $swMathVerParts = explode( ' ' , $swMathVerInfo );
302 $swMathVerInfo = $swMathVerParts[3];
303 } else if ( !strcmp( $swMath, 'imagemagick' ) ) {
304 list( $head, $tail ) = explode( 'ImageMagick', $swMathVerInfo );
305 list( $swMathVerInfo ) = explode('http://www.imagemagick.org', $tail );
307 $swMathVer[$swMath] = trim( $swMathVerInfo );
308 $software["[$swMathURL[$swMath] $swMathName[$swMath]]"] = $swMathVer[$swMath];
314 // Allow a hook to add/remove items
315 wfRunHooks( 'SoftwareInfo', array( &$software ) );
317 $out = Xml
::element( 'h2', array( 'id' => 'mw-version-software' ), wfMsg( 'version-software' ) ) .
318 Xml
::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-software' ) ) .
320 <th>" . wfMsg( 'version-software-product' ) . "</th>
321 <th>" . wfMsg( 'version-software-version' ) . "</th>
323 foreach( $software as $name => $version ) {
325 <td>" . $name . "</td>
326 <td>" . $version . "</td>
329 return $out . Xml
::closeElement( 'table' );
333 * Return a string of the MediaWiki version with SVN revision if available
337 public static function getVersion( $flags = '' ) {
338 global $wgVersion, $IP;
339 wfProfileIn( __METHOD__
);
340 $svn = self
::getSvnRevision( $IP, false, false , false );
341 $svnCo = self
::getSvnRevision( $IP, true, false , false );
343 $version = $wgVersion;
344 } elseif( $flags === 'nodb' ) {
345 $version = "$wgVersion (r$svnCo)";
347 $version = $wgVersion . wfMsg( 'version-svn-revision', $svn, $svnCo );
349 wfProfileOut( __METHOD__
);
354 * Return a string of the MediaWiki version with a link to SVN revision if
359 public static function getVersionLinked() {
360 global $wgVersion, $IP;
361 wfProfileIn( __METHOD__
);
362 $svn = self
::getSvnRevision( $IP, false, false, false );
363 $svnCo = self
::getSvnRevision( $IP, true, false, false );
364 $svnDir = self
::getSvnRevision( $IP, true, false, true );
365 $viewvcStart = 'http://svn.wikimedia.org/viewvc/mediawiki/';
366 $viewvcEnd = '/?pathrev=';
367 $viewvc = $viewvcStart . $svnDir . $viewvcEnd;
368 $version = $svn ?
$wgVersion . " [{$viewvc}{$svnCo} " . wfMsg( 'version-svn-revision', $svn, $svnCo ) . ']' : $wgVersion;
369 wfProfileOut( __METHOD__
);
373 /** Generate wikitext showing extensions name, URL, author and description */
374 function extensionCredits() {
375 global $wgExtensionCredits, $wgExtensionFunctions, $wgParser, $wgSkinExtensionFunctions;
377 if ( ! count( $wgExtensionCredits ) && ! count( $wgExtensionFunctions ) && ! count( $wgSkinExtensionFunctions ) )
380 $extensionTypes = array(
381 'specialpage' => wfMsg( 'version-specialpages' ),
382 'parserhook' => wfMsg( 'version-parserhooks' ),
383 'variable' => wfMsg( 'version-variables' ),
384 'media' => wfMsg( 'version-mediahandlers' ),
385 'other' => wfMsg( 'version-other' ),
387 wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) );
389 $out = Xml
::element( 'h2', array( 'id' => 'mw-version-ext' ), wfMsg( 'version-extensions' ) ) .
390 Xml
::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-ext' ) );
392 foreach ( $extensionTypes as $type => $text ) {
393 if ( isset ( $wgExtensionCredits[$type] ) && count ( $wgExtensionCredits[$type] ) ) {
394 $out .= $this->openExtType( $text );
396 usort( $wgExtensionCredits[$type], array( $this, 'compare' ) );
398 foreach ( $wgExtensionCredits[$type] as $extension ) {
401 $subVersionCo = null;
403 if ( isset( $extension['path'] ) ) {
404 $subVersion = self
::getSvnRevision(dirname($extension['path']), false, true, false);
405 $subVersionCo = self
::getSvnRevision(dirname($extension['path']), true, true, false);
406 $subVersionDir = self
::getSvnRevision(dirname($extension['path']), false, true, true);
408 $viewvc = $subVersionDir . $subVersionCo;
410 if ( isset( $extension['version'] ) ) {
411 $version = $extension['version'];
414 $out .= $this->formatCredits(
415 isset ( $extension['name'] ) ?
$extension['name'] : '',
420 isset ( $extension['author'] ) ?
$extension['author'] : '',
421 isset ( $extension['url'] ) ?
$extension['url'] : null,
422 isset ( $extension['description'] ) ?
$extension['description'] : '',
423 isset ( $extension['descriptionmsg'] ) ?
$extension['descriptionmsg'] : null
429 if ( count( $wgExtensionFunctions ) ) {
430 $out .= $this->openExtType( wfMsg( 'version-extension-functions' ) );
431 $out .= '<tr><td colspan="4">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n";
434 if ( $cnt = count( $tags = $wgParser->getTags() ) ) {
435 for ( $i = 0; $i < $cnt; ++
$i )
436 $tags[$i] = "<{$tags[$i]}>";
437 $out .= $this->openExtType( wfMsg( 'version-parser-extensiontags' ) );
438 $out .= '<tr><td colspan="4">' . $this->listToText( $tags ). "</td></tr>\n";
441 if( $cnt = count( $fhooks = $wgParser->getFunctionHooks() ) ) {
442 $out .= $this->openExtType( wfMsg( 'version-parser-function-hooks' ) );
443 $out .= '<tr><td colspan="4">' . $this->listToText( $fhooks ) . "</td></tr>\n";
446 if ( count( $wgSkinExtensionFunctions ) ) {
447 $out .= $this->openExtType( wfMsg( 'version-skin-extension-functions' ) );
448 $out .= '<tr><td colspan="4">' . $this->listToText( $wgSkinExtensionFunctions ) . "</td></tr>\n";
450 $out .= Xml
::closeElement( 'table' );
454 /** Callback to sort extensions by type */
455 function compare( $a, $b ) {
457 if( $a['name'] === $b['name'] ) {
460 return $wgLang->lc( $a['name'] ) > $wgLang->lc( $b['name'] )
466 function formatCredits( $name, $version = null, $subVersion = null, $subVersionCo = null, $subVersionURL = null, $author = null, $url = null, $description = null, $descriptionMsg = null ) {
467 $haveSubversion = $subVersion;
468 $extension = isset( $url ) ?
"[$url $name]" : $name;
469 $version = isset( $version ) ?
wfMsg( 'version-version', $version ) : '';
470 $subVersion = isset( $subVersion ) ?
wfMsg( 'version-svn-revision', $subVersion, $subVersionCo ) : '';
471 $subVersion = isset( $subVersionURL ) ?
"[$subVersionURL $subVersion]" : $subVersion;
473 # Look for a localized description
474 if( isset( $descriptionMsg ) ) {
475 $msg = wfMsg( $descriptionMsg );
476 if ( !wfEmptyMsg( $descriptionMsg, $msg ) && $msg != '' ) {
481 if ( $haveSubversion ) {
483 <td><em>$extension $version</em></td>
484 <td><em>$subVersion</em></td>";
487 <td colspan=\"2\"><em>$extension $version</em></td>";
489 $extDescAuthor = "<td>$description</td>
490 <td>" . $this->listToText( (array)$author ) . "</td>
492 return $ret = $extNameVer . $extDescAuthor;
502 if ( count( $wgHooks ) ) {
503 $myWgHooks = $wgHooks;
506 $ret = Xml
::element( 'h2', array( 'id' => 'mw-version-hooks' ), wfMsg( 'version-hooks' ) ) .
507 Xml
::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-hooks' ) ) .
509 <th>" . wfMsg( 'version-hook-name' ) . "</th>
510 <th>" . wfMsg( 'version-hook-subscribedby' ) . "</th>
513 foreach ( $myWgHooks as $hook => $hooks )
516 <td>" . $this->listToText( $hooks ) . "</td>
519 $ret .= Xml
::closeElement( 'table' );
525 private function openExtType($text, $name = null) {
526 $opt = array( 'colspan' => 4 );
529 if(!$this->firstExtOpened
) {
530 // Insert a spacing line
531 $out .= '<tr class="sv-space">' . Xml
::element( 'td', $opt ) . "</tr>\n";
533 $this->firstExtOpened
= false;
535 if($name) { $opt['id'] = "sv-$name"; }
537 $out .= "<tr>" . Xml
::element( 'th', $opt, $text) . "</tr>\n";
545 $ip = str_replace( '--', ' - ', htmlspecialchars( wfGetIP() ) );
546 return "<!-- visited from $ip -->\n" .
547 "<span style='display:none'>visited from $ip</span>";
554 function listToText( $list ) {
555 $cnt = count( $list );
558 // Enforce always returning a string
559 return (string)self
::arrayToString( $list[0] );
560 } elseif ( $cnt == 0 ) {
565 return $wgLang->listToText( array_map( array( __CLASS__
, 'arrayToString' ), $list ) );
570 * @param mixed $list Will convert an array to string if given and return
571 * the paramater unaltered otherwise
574 static function arrayToString( $list ) {
575 if( is_array( $list ) && count( $list ) == 1 )
577 if( is_object( $list ) ) {
578 $class = get_class( $list );
580 } elseif ( !is_array( $list ) ) {
583 if( is_object( $list[0] ) )
584 $class = get_class( $list[0] );
587 return "($class, {$list[1]})";
592 * Retrieve the revision number of a Subversion working directory.
594 * @param String $dir Directory of the svn checkout
595 * @param Boolean $coRev optional to return value whether is Last Modified
596 * or Checkout revision number
597 * @param Boolean $extension optional to check the path whether is from
598 * Wikimedia SVN server or not
599 * @param Boolean $relPath optional to get the end part of the checkout path
600 * @return mixed revision number as int, end part of the checkout path,
601 * or false if not a SVN checkout
603 public static function getSvnRevision( $dir, $coRev = false, $extension = false, $relPath = false) {
604 // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html
605 $entries = $dir . '/.svn/entries';
607 if( !file_exists( $entries ) ) {
611 $content = file( $entries );
613 // check if file is xml (subversion release <= 1.3) or not (subversion release = 1.4)
614 if( preg_match( '/^<\?xml/', $content[0] ) ) {
615 // subversion is release <= 1.3
616 if( !function_exists( 'simplexml_load_file' ) ) {
617 // We could fall back to expat... YUCK
621 // SimpleXml whines about the xmlns...
622 wfSuppressWarnings();
623 $xml = simplexml_load_file( $entries );
627 foreach( $xml->entry
as $entry ) {
628 if( $xml->entry
[0]['name'] == '' ) {
629 // The directory entry should always have a revision marker.
630 if( $entry['revision'] ) {
631 return intval( $entry['revision'] );
638 // subversion is release 1.4 or above
640 $endPath = strstr( $content[4], 'tags' );
642 $endPath = strstr( $content[4], 'branches' );
644 $endPath = strstr( $content[4], 'trunk' );
649 $endPath = trim ( $endPath );
651 $wmSvnPath = 'svn.wikimedia.org/svnroot/mediawiki';
652 $isWMSvn = strstr($content[5],$wmSvnPath);
653 if (!strcmp($isWMSvn,null)) {
656 $viewvcStart = 'http://svn.wikimedia.org/viewvc/mediawiki/';
657 if (strstr( $content[4], 'trunk' ))
658 $viewvcEnd = '/?pathrev=';
660 // Avoids 404 error using pathrev when it does not found
661 $viewvcEnd = '/?revision=';
662 $viewvc = $viewvcStart . $endPath . $viewvcEnd;
669 // get the directory checkout revsion number
670 return intval( $content[3]) ;
672 // get the directory last modified revision number
673 return intval( $content[10] );