MediaWiki
REL1_21
|
00001 <?php 00031 class SpecialVersion extends SpecialPage { 00032 00033 protected $firstExtOpened = false; 00034 00035 protected static $extensionTypes = false; 00036 00037 protected static $viewvcUrls = array( 00038 'svn+ssh://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki', 00039 'http://svn.wikimedia.org/svnroot/mediawiki' => 'http://svn.wikimedia.org/viewvc/mediawiki', 00040 'https://svn.wikimedia.org/svnroot/mediawiki' => 'https://svn.wikimedia.org/viewvc/mediawiki', 00041 ); 00042 00043 public function __construct() { 00044 parent::__construct( 'Version' ); 00045 } 00046 00050 public function execute( $par ) { 00051 global $wgSpecialVersionShowHooks, $IP; 00052 00053 $this->setHeaders(); 00054 $this->outputHeader(); 00055 $out = $this->getOutput(); 00056 $out->allowClickjacking(); 00057 00058 if( $par !== 'Credits' ) { 00059 $text = 00060 $this->getMediaWikiCredits() . 00061 $this->softwareInformation() . 00062 $this->getEntryPointInfo() . 00063 $this->getExtensionCredits(); 00064 if ( $wgSpecialVersionShowHooks ) { 00065 $text .= $this->getWgHooks(); 00066 } 00067 00068 $out->addWikiText( $text ); 00069 $out->addHTML( $this->IPInfo() ); 00070 00071 if ( $this->getRequest()->getVal( 'easteregg' ) ) { 00072 if ( $this->showEasterEgg() ) { 00073 // TODO: put something interesting here 00074 } 00075 } 00076 } else { 00077 // Credits sub page 00078 00079 // Header 00080 $out->addHTML( wfMessage( 'version-credits-summary' )->parseAsBlock() ); 00081 00082 $wikiText = file_get_contents( $IP . '/CREDITS' ); 00083 00084 // Take everything from the first section onwards, to remove the (not localized) header 00085 $wikiText = substr( $wikiText, strpos( $wikiText, '==' ) ); 00086 00087 $out->addWikiText( $wikiText ); 00088 } 00089 } 00090 00096 private static function getMediaWikiCredits() { 00097 $ret = Xml::element( 'h2', array( 'id' => 'mw-version-license' ), wfMessage( 'version-license' )->text() ); 00098 00099 // This text is always left-to-right. 00100 $ret .= '<div class="plainlinks">'; 00101 $ret .= "__NOTOC__ 00102 " . self::getCopyrightAndAuthorList() . "\n 00103 " . wfMessage( 'version-license-info' )->text(); 00104 $ret .= '</div>'; 00105 00106 return str_replace( "\t\t", '', $ret ) . "\n"; 00107 } 00108 00114 public static function getCopyrightAndAuthorList() { 00115 global $wgLang; 00116 00117 if ( defined( 'MEDIAWIKI_INSTALL' ) ) { 00118 $othersLink = '[http://www.mediawiki.org/wiki/Special:Version/Credits ' . wfMessage( 'version-poweredby-others' )->text() . ']'; 00119 } else { 00120 $othersLink = '[[Special:Version/Credits|' . wfMessage( 'version-poweredby-others' )->text() . ']]'; 00121 } 00122 00123 $authorList = array( 00124 'Magnus Manske', 'Brion Vibber', 'Lee Daniel Crocker', 00125 'Tim Starling', 'Erik Möller', 'Gabriel Wicke', 'Ævar Arnfjörð Bjarmason', 00126 'Niklas Laxström', 'Domas Mituzas', 'Rob Church', 'Yuri Astrakhan', 00127 'Aryeh Gregor', 'Aaron Schulz', 'Andrew Garrett', 'Raimond Spekking', 00128 'Alexandre Emsenhuber', 'Siebrand Mazeland', 'Chad Horohoe', 00129 'Roan Kattouw', 'Trevor Parscal', 'Bryan Tong Minh', 'Sam Reed', 00130 'Victor Vasiliev', 'Rotem Liss', 'Platonides', 'Antoine Musso', 00131 'Timo Tijhof', 'Daniel Kinzler', 'Jeroen De Dauw', $othersLink 00132 ); 00133 00134 return wfMessage( 'version-poweredby-credits', date( 'Y' ), 00135 $wgLang->listToText( $authorList ) )->text(); 00136 } 00137 00143 static function softwareInformation() { 00144 $dbr = wfGetDB( DB_SLAVE ); 00145 00146 // Put the software in an array of form 'name' => 'version'. All messages should 00147 // be loaded here, so feel free to use wfMessage in the 'name'. Raw HTML or 00148 // wikimarkup can be used. 00149 $software = array(); 00150 $software['[https://www.mediawiki.org/ MediaWiki]'] = self::getVersionLinked(); 00151 $software['[http://www.php.net/ PHP]'] = phpversion() . " (" . PHP_SAPI . ")"; 00152 $software[$dbr->getSoftwareLink()] = $dbr->getServerInfo(); 00153 00154 // Allow a hook to add/remove items. 00155 wfRunHooks( 'SoftwareInfo', array( &$software ) ); 00156 00157 $out = Xml::element( 'h2', array( 'id' => 'mw-version-software' ), wfMessage( 'version-software' )->text() ) . 00158 Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-software' ) ) . 00159 "<tr> 00160 <th>" . wfMessage( 'version-software-product' )->text() . "</th> 00161 <th>" . wfMessage( 'version-software-version' )->text() . "</th> 00162 </tr>\n"; 00163 00164 foreach( $software as $name => $version ) { 00165 $out .= "<tr> 00166 <td>" . $name . "</td> 00167 <td dir=\"ltr\">" . $version . "</td> 00168 </tr>\n"; 00169 } 00170 00171 return $out . Xml::closeElement( 'table' ); 00172 } 00173 00180 public static function getVersion( $flags = '' ) { 00181 global $wgVersion, $IP; 00182 wfProfileIn( __METHOD__ ); 00183 00184 $gitInfo = self::getGitHeadSha1( $IP ); 00185 $svnInfo = self::getSvnInfo( $IP ); 00186 if ( !$svnInfo && !$gitInfo ) { 00187 $version = $wgVersion; 00188 } elseif ( $gitInfo && $flags === 'nodb' ) { 00189 $shortSha1 = substr( $gitInfo, 0, 7 ); 00190 $version = "$wgVersion ($shortSha1)"; 00191 } elseif ( $gitInfo ) { 00192 $shortSha1 = substr( $gitInfo, 0, 7 ); 00193 $shortSha1 = wfMessage( 'parentheses' )->params( $shortSha1 )->escaped(); 00194 $version = "$wgVersion $shortSha1"; 00195 } elseif ( $flags === 'nodb' ) { 00196 $version = "$wgVersion (r{$svnInfo['checkout-rev']})"; 00197 } else { 00198 $version = $wgVersion . ' ' . 00199 wfMessage( 00200 'version-svn-revision', 00201 isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', 00202 $info['checkout-rev'] 00203 )->text(); 00204 } 00205 00206 wfProfileOut( __METHOD__ ); 00207 return $version; 00208 } 00209 00218 public static function getVersionLinked() { 00219 global $wgVersion; 00220 wfProfileIn( __METHOD__ ); 00221 00222 $gitVersion = self::getVersionLinkedGit(); 00223 if( $gitVersion ) { 00224 $v = $gitVersion; 00225 } else { 00226 $svnVersion = self::getVersionLinkedSvn(); 00227 if( $svnVersion ) { 00228 $v = $svnVersion; 00229 } else { 00230 $v = $wgVersion; // fallback 00231 } 00232 } 00233 00234 wfProfileOut( __METHOD__ ); 00235 return $v; 00236 } 00237 00241 private static function getVersionLinkedSvn() { 00242 global $IP; 00243 00244 $info = self::getSvnInfo( $IP ); 00245 if( !isset( $info['checkout-rev'] ) ) { 00246 return false; 00247 } 00248 00249 $linkText = wfMessage( 00250 'version-svn-revision', 00251 isset( $info['directory-rev'] ) ? $info['directory-rev'] : '', 00252 $info['checkout-rev'] 00253 )->text(); 00254 00255 if ( isset( $info['viewvc-url'] ) ) { 00256 $version = "[{$info['viewvc-url']} $linkText]"; 00257 } else { 00258 $version = $linkText; 00259 } 00260 00261 return self::getwgVersionLinked() . " $version"; 00262 } 00263 00267 private static function getwgVersionLinked() { 00268 global $wgVersion; 00269 $versionUrl = ""; 00270 if( wfRunHooks( 'SpecialVersionVersionUrl', array( $wgVersion, &$versionUrl ) ) ) { 00271 $versionParts = array(); 00272 preg_match( "/^(\d+\.\d+)/", $wgVersion, $versionParts ); 00273 $versionUrl = "https://www.mediawiki.org/wiki/MediaWiki_{$versionParts[1]}"; 00274 } 00275 return "[$versionUrl $wgVersion]"; 00276 } 00277 00281 private static function getVersionLinkedGit() { 00282 global $IP; 00283 00284 $gitInfo = new GitInfo( $IP ); 00285 $headSHA1 = $gitInfo->getHeadSHA1(); 00286 if( !$headSHA1 ) { 00287 return false; 00288 } 00289 00290 $shortSHA1 = '(' . substr( $headSHA1, 0, 7 ) . ')'; 00291 $viewerUrl = $gitInfo->getHeadViewUrl(); 00292 if ( $viewerUrl !== false ) { 00293 $shortSHA1 = "[$viewerUrl $shortSHA1]"; 00294 } 00295 return self::getwgVersionLinked() . " $shortSHA1"; 00296 } 00297 00310 public static function getExtensionTypes() { 00311 if ( self::$extensionTypes === false ) { 00312 self::$extensionTypes = array( 00313 'specialpage' => wfMessage( 'version-specialpages' )->text(), 00314 'parserhook' => wfMessage( 'version-parserhooks' )->text(), 00315 'variable' => wfMessage( 'version-variables' )->text(), 00316 'media' => wfMessage( 'version-mediahandlers' )->text(), 00317 'antispam' => wfMessage( 'version-antispam' )->text(), 00318 'skin' => wfMessage( 'version-skins' )->text(), 00319 'api' => wfMessage( 'version-api' )->text(), 00320 'other' => wfMessage( 'version-other' )->text(), 00321 ); 00322 00323 wfRunHooks( 'ExtensionTypes', array( &self::$extensionTypes ) ); 00324 } 00325 00326 return self::$extensionTypes; 00327 } 00328 00338 public static function getExtensionTypeName( $type ) { 00339 $types = self::getExtensionTypes(); 00340 return isset( $types[$type] ) ? $types[$type] : $types['other']; 00341 } 00342 00348 function getExtensionCredits() { 00349 global $wgExtensionCredits, $wgExtensionFunctions, $wgParser; 00350 00351 if ( !count( $wgExtensionCredits ) && !count( $wgExtensionFunctions ) ) { 00352 return ''; 00353 } 00354 00355 $extensionTypes = self::getExtensionTypes(); 00356 00360 wfRunHooks( 'SpecialVersionExtensionTypes', array( &$this, &$extensionTypes ) ); 00361 00362 $out = Xml::element( 'h2', array( 'id' => 'mw-version-ext' ), $this->msg( 'version-extensions' )->text() ) . 00363 Xml::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-ext' ) ); 00364 00365 // Make sure the 'other' type is set to an array. 00366 if ( !array_key_exists( 'other', $wgExtensionCredits ) ) { 00367 $wgExtensionCredits['other'] = array(); 00368 } 00369 00370 // Find all extensions that do not have a valid type and give them the type 'other'. 00371 foreach ( $wgExtensionCredits as $type => $extensions ) { 00372 if ( !array_key_exists( $type, $extensionTypes ) ) { 00373 $wgExtensionCredits['other'] = array_merge( $wgExtensionCredits['other'], $extensions ); 00374 } 00375 } 00376 00377 // Loop through the extension categories to display their extensions in the list. 00378 foreach ( $extensionTypes as $type => $message ) { 00379 if ( $type != 'other' ) { 00380 $out .= $this->getExtensionCategory( $type, $message ); 00381 } 00382 } 00383 00384 // We want the 'other' type to be last in the list. 00385 $out .= $this->getExtensionCategory( 'other', $extensionTypes['other'] ); 00386 00387 if ( count( $wgExtensionFunctions ) ) { 00388 $out .= $this->openExtType( $this->msg( 'version-extension-functions' )->text(), 'extension-functions' ); 00389 $out .= '<tr><td colspan="4">' . $this->listToText( $wgExtensionFunctions ) . "</td></tr>\n"; 00390 } 00391 00392 $tags = $wgParser->getTags(); 00393 $cnt = count( $tags ); 00394 00395 if ( $cnt ) { 00396 for ( $i = 0; $i < $cnt; ++$i ) { 00397 $tags[$i] = "<{$tags[$i]}>"; 00398 } 00399 $out .= $this->openExtType( $this->msg( 'version-parser-extensiontags' )->text(), 'parser-tags' ); 00400 $out .= '<tr><td colspan="4">' . $this->listToText( $tags ). "</td></tr>\n"; 00401 } 00402 00403 $fhooks = $wgParser->getFunctionHooks(); 00404 if( count( $fhooks ) ) { 00405 $out .= $this->openExtType( $this->msg( 'version-parser-function-hooks' )->text(), 'parser-function-hooks' ); 00406 $out .= '<tr><td colspan="4">' . $this->listToText( $fhooks ) . "</td></tr>\n"; 00407 } 00408 00409 $out .= Xml::closeElement( 'table' ); 00410 00411 return $out; 00412 } 00413 00424 protected function getExtensionCategory( $type, $message ) { 00425 global $wgExtensionCredits; 00426 00427 $out = ''; 00428 00429 if ( array_key_exists( $type, $wgExtensionCredits ) && count( $wgExtensionCredits[$type] ) > 0 ) { 00430 $out .= $this->openExtType( $message, 'credits-' . $type ); 00431 00432 usort( $wgExtensionCredits[$type], array( $this, 'compare' ) ); 00433 00434 foreach ( $wgExtensionCredits[$type] as $extension ) { 00435 $out .= $this->getCreditsForExtension( $extension ); 00436 } 00437 } 00438 00439 return $out; 00440 } 00441 00448 function compare( $a, $b ) { 00449 if( $a['name'] === $b['name'] ) { 00450 return 0; 00451 } else { 00452 return $this->getLanguage()->lc( $a['name'] ) > $this->getLanguage()->lc( $b['name'] ) 00453 ? 1 00454 : -1; 00455 } 00456 } 00457 00465 function getCreditsForExtension( array $extension ) { 00466 $name = isset( $extension['name'] ) ? $extension['name'] : '[no name]'; 00467 00468 $vcsText = false; 00469 00470 if ( isset( $extension['path'] ) ) { 00471 $gitInfo = new GitInfo( dirname( $extension['path'] ) ); 00472 $gitHeadSHA1 = $gitInfo->getHeadSHA1(); 00473 if ( $gitHeadSHA1 !== false ) { 00474 $vcsText = '(' . substr( $gitHeadSHA1, 0, 7 ) . ')'; 00475 $gitViewerUrl = $gitInfo->getHeadViewUrl(); 00476 if ( $gitViewerUrl !== false ) { 00477 $vcsText = "[$gitViewerUrl $vcsText]"; 00478 } 00479 } else { 00480 $svnInfo = self::getSvnInfo( dirname( $extension['path'] ) ); 00481 # Make subversion text/link. 00482 if ( $svnInfo !== false ) { 00483 $directoryRev = isset( $svnInfo['directory-rev'] ) ? $svnInfo['directory-rev'] : null; 00484 $vcsText = $this->msg( 'version-svn-revision', $directoryRev, $svnInfo['checkout-rev'] )->text(); 00485 $vcsText = isset( $svnInfo['viewvc-url'] ) ? '[' . $svnInfo['viewvc-url'] . " $vcsText]" : $vcsText; 00486 } 00487 } 00488 } 00489 00490 # Make main link (or just the name if there is no URL). 00491 if ( isset( $extension['url'] ) ) { 00492 $mainLink = "[{$extension['url']} $name]"; 00493 } else { 00494 $mainLink = $name; 00495 } 00496 00497 if ( isset( $extension['version'] ) ) { 00498 $versionText = '<span class="mw-version-ext-version">' . 00499 $this->msg( 'version-version', $extension['version'] )->text() . 00500 '</span>'; 00501 } else { 00502 $versionText = ''; 00503 } 00504 00505 # Make description text. 00506 $description = isset ( $extension['description'] ) ? $extension['description'] : ''; 00507 00508 if( isset ( $extension['descriptionmsg'] ) ) { 00509 # Look for a localized description. 00510 $descriptionMsg = $extension['descriptionmsg']; 00511 00512 if( is_array( $descriptionMsg ) ) { 00513 $descriptionMsgKey = $descriptionMsg[0]; // Get the message key 00514 array_shift( $descriptionMsg ); // Shift out the message key to get the parameters only 00515 array_map( "htmlspecialchars", $descriptionMsg ); // For sanity 00516 $description = $this->msg( $descriptionMsgKey, $descriptionMsg )->text(); 00517 } else { 00518 $description = $this->msg( $descriptionMsg )->text(); 00519 } 00520 } 00521 00522 if ( $vcsText !== false ) { 00523 $extNameVer = "<tr> 00524 <td><em>$mainLink $versionText</em></td> 00525 <td><em>$vcsText</em></td>"; 00526 } else { 00527 $extNameVer = "<tr> 00528 <td colspan=\"2\"><em>$mainLink $versionText</em></td>"; 00529 } 00530 00531 $author = isset ( $extension['author'] ) ? $extension['author'] : array(); 00532 $extDescAuthor = "<td>$description</td> 00533 <td>" . $this->listAuthors( $author, false ) . "</td> 00534 </tr>\n"; 00535 00536 return $extNameVer . $extDescAuthor; 00537 } 00538 00544 private function getWgHooks() { 00545 global $wgHooks; 00546 00547 if ( count( $wgHooks ) ) { 00548 $myWgHooks = $wgHooks; 00549 ksort( $myWgHooks ); 00550 00551 $ret = Xml::element( 'h2', array( 'id' => 'mw-version-hooks' ), $this->msg( 'version-hooks' )->text() ) . 00552 Xml::openElement( 'table', array( 'class' => 'wikitable', 'id' => 'sv-hooks' ) ) . 00553 "<tr> 00554 <th>" . $this->msg( 'version-hook-name' )->text() . "</th> 00555 <th>" . $this->msg( 'version-hook-subscribedby' )->text() . "</th> 00556 </tr>\n"; 00557 00558 foreach ( $myWgHooks as $hook => $hooks ) { 00559 $ret .= "<tr> 00560 <td>$hook</td> 00561 <td>" . $this->listToText( $hooks ) . "</td> 00562 </tr>\n"; 00563 } 00564 00565 $ret .= Xml::closeElement( 'table' ); 00566 return $ret; 00567 } else 00568 return ''; 00569 } 00570 00571 private function openExtType( $text, $name = null ) { 00572 $opt = array( 'colspan' => 4 ); 00573 $out = ''; 00574 00575 if( $this->firstExtOpened ) { 00576 // Insert a spacing line 00577 $out .= '<tr class="sv-space">' . Html::element( 'td', $opt ) . "</tr>\n"; 00578 } 00579 $this->firstExtOpened = true; 00580 00581 if( $name ) { 00582 $opt['id'] = "sv-$name"; 00583 } 00584 00585 $out .= "<tr>" . Xml::element( 'th', $opt, $text ) . "</tr>\n"; 00586 00587 return $out; 00588 } 00589 00595 private function IPInfo() { 00596 $ip = str_replace( '--', ' - ', htmlspecialchars( $this->getRequest()->getIP() ) ); 00597 return "<!-- visited from $ip -->\n<span style='display:none'>visited from $ip</span>"; 00598 } 00599 00606 function listAuthors( $authors ) { 00607 $list = array(); 00608 foreach( (array)$authors as $item ) { 00609 if ( $item == '...' ) { 00610 $list[] = $this->msg( 'version-poweredby-others' )->text(); 00611 } elseif ( substr( $item, -5 ) == ' ...]' ) { 00612 $list[] = substr( $item, 0, -4 ) . $this->msg( 'version-poweredby-others' )->text() . "]"; 00613 } else { 00614 $list[] = $item; 00615 } 00616 } 00617 return $this->listToText( $list, false ); 00618 } 00619 00628 function listToText( $list, $sort = true ) { 00629 $cnt = count( $list ); 00630 00631 if ( $cnt == 1 ) { 00632 // Enforce always returning a string 00633 return (string)self::arrayToString( $list[0] ); 00634 } elseif ( $cnt == 0 ) { 00635 return ''; 00636 } else { 00637 if ( $sort ) { 00638 sort( $list ); 00639 } 00640 return $this->getLanguage()->listToText( array_map( array( __CLASS__, 'arrayToString' ), $list ) ); 00641 } 00642 } 00643 00652 public static function arrayToString( $list ) { 00653 if( is_array( $list ) && count( $list ) == 1 ) { 00654 $list = $list[0]; 00655 } 00656 if( is_object( $list ) ) { 00657 $class = wfMessage( 'parentheses' )->params( get_class( $list ) )->escaped(); 00658 return $class; 00659 } elseif ( !is_array( $list ) ) { 00660 return $list; 00661 } else { 00662 if( is_object( $list[0] ) ) { 00663 $class = get_class( $list[0] ); 00664 } else { 00665 $class = $list[0]; 00666 } 00667 return wfMessage( 'parentheses' )->params( "$class, {$list[1]}" )->escaped(); 00668 } 00669 } 00670 00687 public static function getSvnInfo( $dir ) { 00688 // http://svnbook.red-bean.com/nightly/en/svn.developer.insidewc.html 00689 $entries = $dir . '/.svn/entries'; 00690 00691 if( !file_exists( $entries ) ) { 00692 return false; 00693 } 00694 00695 $lines = file( $entries ); 00696 if ( !count( $lines ) ) { 00697 return false; 00698 } 00699 00700 // check if file is xml (subversion release <= 1.3) or not (subversion release = 1.4) 00701 if( preg_match( '/^<\?xml/', $lines[0] ) ) { 00702 // subversion is release <= 1.3 00703 if( !function_exists( 'simplexml_load_file' ) ) { 00704 // We could fall back to expat... YUCK 00705 return false; 00706 } 00707 00708 // SimpleXml whines about the xmlns... 00709 wfSuppressWarnings(); 00710 $xml = simplexml_load_file( $entries ); 00711 wfRestoreWarnings(); 00712 00713 if( $xml ) { 00714 foreach( $xml->entry as $entry ) { 00715 if( $xml->entry[0]['name'] == '' ) { 00716 // The directory entry should always have a revision marker. 00717 if( $entry['revision'] ) { 00718 return array( 'checkout-rev' => intval( $entry['revision'] ) ); 00719 } 00720 } 00721 } 00722 } 00723 00724 return false; 00725 } 00726 00727 // Subversion is release 1.4 or above. 00728 if ( count( $lines ) < 11 ) { 00729 return false; 00730 } 00731 00732 $info = array( 00733 'checkout-rev' => intval( trim( $lines[3] ) ), 00734 'url' => trim( $lines[4] ), 00735 'repo-url' => trim( $lines[5] ), 00736 'directory-rev' => intval( trim( $lines[10] ) ) 00737 ); 00738 00739 if ( isset( self::$viewvcUrls[$info['repo-url']] ) ) { 00740 $viewvc = str_replace( 00741 $info['repo-url'], 00742 self::$viewvcUrls[$info['repo-url']], 00743 $info['url'] 00744 ); 00745 00746 $viewvc .= '/?pathrev='; 00747 $viewvc .= urlencode( $info['checkout-rev'] ); 00748 $info['viewvc-url'] = $viewvc; 00749 } 00750 00751 return $info; 00752 } 00753 00761 public static function getSvnRevision( $dir ) { 00762 $info = self::getSvnInfo( $dir ); 00763 00764 if ( $info === false ) { 00765 return false; 00766 } elseif ( isset( $info['checkout-rev'] ) ) { 00767 return $info['checkout-rev']; 00768 } else { 00769 return false; 00770 } 00771 } 00772 00777 public static function getGitHeadSha1( $dir ) { 00778 $repo = new GitInfo( $dir ); 00779 return $repo->getHeadSHA1(); 00780 } 00781 00786 public function getEntryPointInfo() { 00787 global $wgArticlePath, $wgScriptPath; 00788 $scriptPath = $wgScriptPath ? $wgScriptPath : "/"; 00789 $entryPoints = array( 00790 'version-entrypoints-articlepath' => $wgArticlePath, 00791 'version-entrypoints-scriptpath' => $scriptPath, 00792 'version-entrypoints-index-php' => wfScript( 'index' ), 00793 'version-entrypoints-api-php' => wfScript( 'api' ), 00794 'version-entrypoints-load-php' => wfScript( 'load' ), 00795 ); 00796 00797 $language = $this->getLanguage(); 00798 $thAttribures = array( 00799 'dir' => $language->getDir(), 00800 'lang' => $language->getCode() 00801 ); 00802 $out = Html::element( 'h2', array( 'id' => 'mw-version-entrypoints' ), $this->msg( 'version-entrypoints' )->text() ) . 00803 Html::openElement( 'table', 00804 array( 00805 'class' => 'wikitable plainlinks', 00806 'id' => 'mw-version-entrypoints-table', 00807 'dir' => 'ltr', 00808 'lang' => 'en' 00809 ) 00810 ) . 00811 Html::openElement( 'tr' ) . 00812 Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-entrypoint' )->text() ) . 00813 Html::element( 'th', $thAttribures, $this->msg( 'version-entrypoints-header-url' )->text() ) . 00814 Html::closeElement( 'tr' ); 00815 00816 foreach ( $entryPoints as $message => $value ) { 00817 $url = wfExpandUrl( $value, PROTO_RELATIVE ); 00818 $out .= Html::openElement( 'tr' ) . 00819 // ->text() looks like it should be ->parse(), but this function 00820 // returns wikitext, not HTML, boo 00821 Html::rawElement( 'td', array(), $this->msg( $message )->text() ) . 00822 Html::rawElement( 'td', array(), Html::rawElement( 'code', array(), "[$url $value]" ) ) . 00823 Html::closeElement( 'tr' ); 00824 } 00825 00826 $out .= Html::closeElement( 'table' ); 00827 return $out; 00828 } 00829 00830 protected function getGroupName() { 00831 return 'wiki'; 00832 } 00833 00834 function showEasterEgg() { 00835 $rx = $rp = $xe = ''; 00836 $alpha = array( "", "kbQW", "\$\n()" ); 00837 $beta = implode( "', '", $alpha); 00838 $juliet = 'echo $delta + strrev( $foxtrot ) - $alfa + $wgVersion . base64_decode( $bravo ) * $charlie'; 00839 for ( $i = 1; $i <= 4; $i++ ) { 00840 $rx .= '([^j]*)J'; 00841 $rp .= "+(\\$i)"; 00842 } 00843 00844 $rx = "/$rx/Sei"; 00845 $O = substr( "$alpha')", 1 ); 00846 for ( $i = 1; $i <= strlen( $rx ) / 3; $i++ ) { 00847 $rx[$i-1] = strtolower( $rx[$i-1] ); 00848 } 00849 $ry = ".*?(.((.)(.))).{1,3}(.)(.{1,$i})(\\4.\\3)(.).*"; 00850 $ry = "/$ry/Sei"; 00851 $O = substr( "$beta')", 1 ); 00852 preg_match_all( '/(?<=\$)[[:alnum:]]*/', substr( $juliet, 0, $i<<1 ), $charlie ); 00853 foreach( $charlie[0] as $bravo ) { 00854 $$bravo =& $xe; 00855 } 00856 $xe = 'xe=<<<mo/./hfromowoxv=<<<m 00857 쵍潅旅왎캎𐺆ߨ趥䲀쫥Ꝍ螃䤎꤯溃櫅褡䞠⽬✡栠迤⾏쾃줏袏浣।궇䬃꼁꿤𘐧 00858 윥桯䦎䵎Ꞅ涁쭀讀撠蝠讄伣枮ⵇ𐡃𐭏沢𞴏⠤쳯蒣䮎컡豣ۅ⦇𐫁漅蛁꼤从楆 00859 ⥀䡦沢⠬輁䲯좡梇䟇伄육较촅䥃要迯쟠꺃ⶥ栆궀撠満ꐣ좧𐠅𐠧讇輤亀➏欣첡쮧⽬ 00860 氀쮧跧𐫥䪀⬬⾅ⵏ괬ত櫤䭀楦괥챣楀귧읠죯쒡ۅ䳄䤄괬躏譇䮄搥䯄津䶮⾅𐫅 00861 𐴂௧쮯궣輥ߡ亀氀诤⿅諃⫤䮣⦬죄椎貧ඇ쿇亏跤⦌术থۏ仆䛇枡䪄곁謠ⶏⶃ䞣 00862 궥螏蝁ꤣ⟬极涇𞴧伢ଅ즡⡌浣䯇쿃ⳇ궏ས⢃曦⦥蛧갠컡楧𘬧袏⦏⢠䳠챤⽧⬣⼀潧⭅椤 00863 軁종쵃䬆꤇溎楯곡⢡꾥첥쫧Ⱨ균檏辀䭮⡄𐞯쿁䱤𐠠柅迠웏⾅豠𐡀𐡅䱀轡⾯쥃⥁溆 00864 䢣䞮柄ꠌⶡ𐳣蛤椏✠귬ຄ䶃毥𞡯桥ꐥ❣쳀⡧𖥢꽧죄തޥ歠ແ위䯎撯쬁䮣浅 00865 쾇泮𐢁켄䦯꾯迡曎䢦쿣杦궯⡀䤦䷢𐭢쟁쯯⧤蟯䡏氇𞢣蝤궧ߢ𐭆䛃찃쭣沠 00866 䴃𐣣䣎𐺃ꥅ轃⣄蟧⦡蟃毣洇䞎Ҡ潄仆𐲃철䢤俎譯泠쮄␥栏쾯ⳏ짡⥡߂ކ澥䲀ⵀ 00867 ⵡ✬輄䱀굡榏❡첄⦄ꡥⶣ𞡤⺁ݣ𐢅⤡꿄蝡ⴄ贁氃ޅ짣߁𐫄ۥ𐱅欤 00868 梢蝡柧䥏仏撣𐳣𞠅좇蒣䰤྅࿂ಇ濤䞦쮅沮潁좤澅杣棦ꤤ洯𐳃콅궧쭠 00869 桎䝆겡쭄겯䥂ⶀ⽬䠇쳄❬Ⰼ䐦⿌웃𒿠첏𐛡浣涆⢤অ䭎갣䴮⡃꤯죠䰀쬯༄䫏 00870 𐱂ꢅ䬦賧유辇➥佃仮귣젏⭅ꢡ각컄⒤⻠讁涅䠃跥袏佄𐳇泄껧棇满གྷ輤괅❥겠 00871 𒐧䣂ꤏ襃伎襡웅걯䳣켁쭄洠컥❅⿏亂쯅⢁𐠦诤꣏辀𖥢椯겇毣濢➠ 00872 䮮浥겁沣졣䜦泇歏𐾄搯曯柆ۇۇ䞀泆武況꽌𐧢ꝅ軀⬠쾣𞡀榧𞣏Ⱡ䠦Ⲥ쿇䬄貃柅涢 00873 갏⼁𐿧ݏౠ𐿣褀涡༅䮄➇ꝣݥ䡏䯎梢輇ꤠ䫣䵀ण漂⢡軀௦襁쫇⾡濧沤 00874 䜇伢ۇ汧첏䤎잤䛯Ⰱ俇ꢧ殂궏榮ޣ涂氏滦즤蜀⠥𐺏쐣⾏껬콇漯Ꝡ柦櫇읁梠仇장滦⟠꿯 00875 쮁搥櫢𐫣ꠏ椥𐛤誅栮朥迣⺄ඇ⿏䬂쾏⫠⒧✏궇襤⡁濃Ⱐ歯䛠쮠𞟤컃𞢯⬣濡䦣 00876 衏貣柂森챏ಇ고蟄䤏젯⫯楀䞄䳣쮅궤轧껯𐪃潇ބ浣𐬀蝤⽧쐣쾇➣𐡦䮠䤣𐠄 00877 Ꝡ𐾁蠤䬦覯搦⥯쥏梂걯ⵁ೦챁躄轡䢦𐝂財䲧𐦁䬎첁棏␣౦잧棆젥襁젃䤏⢏榀ⵁ 00878 螅赡𒿯ⶣ赧꾤濁涆𐴂ॡ䳦ߢ赁䯇䢃ꠌ泄柠泡찇𐛢䪂𐝢櫇漥⟤淣ഡ䳮த谀ཡ 00879 ➁血꽧蟧辧게⻣쳏ഡ䠄杮죃汦諤య毠蝅𐦄謄殯䳀ⳏ쟇ආ잏𐿡䳃ۂ䝇䦇⥌켏쥯춏 00880 𖽢𐳃𐿧𐝢䥦棇潡⥄歡찁朆⻠䤆𖤧漢ꡅ⽄쾠衏䤣অ䤣𐡡𐢏䞦ߣ裏 00881 ཅۄ춁䲃欆귬𐺀诀滁䝃챃첥꺏쫅䱮અ견Ф𐫁佣澢쿏⽅侮榅𐾄य쥏蜏䣣 00882 𐫏쵥➤跡殃䰣䯤읤ⴏ굄⥇줡걬০켃𜼧첣䜂찃궀谀Ɽ伎䢮ꤥ⾣𐭁沅䬇䧠𐱇 00883 沀濡ठ쟠𐺅ꐣ𐴂躄佇⦇毄计賀䢎澡䲄캀䟣褀蠤൯棏蜃澄❧⾥撦⽬ⶥ𐪄யބ躄 00884 䬎챯⽯䬎Ꞅ굥𐢂⠥䝧朄࿏웥꽬གྷ浅⦁❬𐺆侢栦⧠궠ඦ趤谥此𐲂𐬃軠𐞦 00885 蛄俧袥补榏읠⤁⠀豇俢쮯꤇➏𐴁ⶤ涮찣읁榠跣⦅ໃಆ䵣谠ꢯ⡧淯柤궡✠䮎괯❅朎 00886 ⥅웣䯮첀꒤𐣠쭏洀蛡楆ൡ䮮ү氠𐜏濆䜢䷯潣歃䷯웁쭄椥䟂➅ૡༀ䭧ܣ죅ए軯䧣 00887 Ⱔ䐢⬥檂䠮⫤䛠꜡䛆讠✠꿏欣蠡켏豣譄𞣇춣䠃䰠撦朅䮄榦溃貀䶇⾁澡䲮榀 00888 𐪄䢆侄朦꜇ཏ췧꺁枠櫧桠괬枇ꜯ곇𐰂𘜧𐦄컡濦汥줠𞲡輀𐠣쥇⣃𞴏䳂⟤漇쯣껃𐾀衃 00889 쯇𐝄浥洄楠৯춥蒧⾯𐫆༂ꤌ毮䤆⺄༠०袀䢂죃ⴣ𐿯梇溄毦螄櫤쳃栅満걌毠ⱌ꒧䢆 00890 ꥁ泎仧궀辯諯웅津趃অ꿏伏캁⠃𐦂ꝣ䛂贤济杧𐝁撠䱤殥歡躇楄꒧꽧䡣쵧𐱆ꜯ위 00891 ཀ谠諃𐬃軅␥贠撣߅꽤⠥ಡ𐝀궥윁Ⰴܯ즡歎ⵅഏ蝁구ꝧ܅䱦껡䛦߅蒯俧콣梧䛠ꡇ 00892 ݧ웥Т⬠䬦榀𐢂貤謣䱦⒡췧濇⧣⤀좯殧줤⣀楏楎굏ݤ滁ۇ𘐧䒯Ⰰҡ䰦椯❏ 00893 趯𐣯豀쵅춀⳥䷠읡ۯ⺄ۅ䶏춤枂櫅ۅ𞥅䱃䭣汮澃𞢃谥ⵤ구콡曤𞣏ই߂읅蠠䞦ꞇⲏ諧 00894 趯첏䬎𐡏李겠⥇曢汥浆欠躅𐦁𞲯谡袧襃棧𞡡蟀侠찇챠쪇洠܀쯤䝇螏蜏俄⼀ལ 00895 谥촯䲦⥁ඤ𐐧⤃궅༡褡䭏毆濆⧡蛣Ф蠏ݤ賯꜁溅⡡ߡ䮄榆䵄求謥𐐧Ꞁ쯏⧡貇䛇䐢撦袥 00896 쮇䫀দ굯⻤襇줅⬅ہఠ⻀쒠䫆𐡅梄梯輤䥣읏⤄ⶡ诃䮢譡ߤ枤櫥伦袠ꢃ쳀裣䰄 00897 槥淠䯃ඏ⒯𞠣椦泮汣赃潥ദ䰏쮡蝏毁䶂䦧档䪂쟀𐿯졇웄䳎汀𐫣 00898 漠ꐡଥ认꽡𐭏⦄梎આ枀䠦楇쒤ꞃꤡⴅꞅඅҡ氣즤裀櫁༦𐳃쳣𐡯桧权굁죁 00899 짤𖤧蟃澀𞲯ߏ⣣⬁Ⱔ졥潆ꐡ⽤웁浥𐫄棆갤濧⼣겅쬄൧젣此潆⻯䜃꤯궠쮥𘬧曀⿅譅槣䞂 00900 䝎ꡏ䰀梥⾬ܡ𞠥𞺃䢮આ䧮쮃誅櫆죯诠䵀䯀跥⻥䤆Ⰰ꜄棧枃⻇థ誃࿇贄𞡣欎⽡ 00901 𞲄⬏杇𐠅𐱃𞢤➁𐢄꒥즏亀쭁漆첁殎쮁滠𐠥榯⡀䮆䣠준讥䶇⪅껃泃楀갠複撮 00902 ✡𐭢ແ쫃⽤規䥇沁轁𐡅ಢ䧮椁⬇𐤁𞡯杅武楥歎䟄溇䯢迃䪎䳤满ଅⱇ쭀ಥ𞥄䥆⧥좃 00903 유栤༡𐰃俇Ⰵ殇蠄⽏⾠܇澄⡤䪎榮Я견濂賣쮠仠䝮䶢𐫆ݏ襅褥찯𞤤ݥ象侯쵇궥𞠃윀웧 00904 殀蛡⫥亃觯潥蠀补ⴄ觧𐡇𐾆ꐯ䡣췡潏⻯⾁諏య꿧䱠찥ꞅ⪃콄즯쳣覧Ⲅ쐯⬃ඤ겤 00905 ⵃ蟥谣轇䛂𐮄佀߁氣榡桇䷯觠椄챥ꠌ蒯꜌䭤➡侦䣤䲀쥁⒤𐦄Ꝭ䢮ꡌ歡䝯䢣괯⥀ 00906 줣०殣⟄趥좠洦ꢬ装䠆曧➁𒿧椃䠀𞡅𖼧䳇ງ줄ধⰬ覠ꝃ殣涡䳠귥⫤覯𞲡༦ 00907 䢦쥥줤ꡤড젃ಧꢥ諤ඥ枅줄躀ఏ䦎졯譄➇仄䰏蛏촡䞣춅涧⡄滀ଢ䮇每𘠧侇澀ꐡ杣 00908 槧߅䶠윥귡귧⤯ཆ裁毧⬤蝧첀⭁潤䝎池殤Ҡ䝯ཁ쟧氢귡𒿯ꥄ⭌䜇ۥ 00909 ꝡ棄⣏ꤥ০쮁桧𐐧ⴤꠡ軅衄䠦ߤ܅ⲃଢ蛄溎椀𞠀䛃𞡣𞟣澅䧤⡇贤⫌쪄ށ朣 00910 ⻏켅⼡𐲀잠௧𞥀౧䦤ས誇漎譠迄䦂䳇正계楧ޅ✬棅쭯诠枢䥮䭆楆컧ଆ 00911 ➬అ䤦誃𐠅𐿤䟀洀⡤滤𞥇즀𐠁⼃䰎溄꽅웇✡䲀⡏ܣ讣⼤覄䡇అ蝀⥌侧껄Ꝭ流贀 00912 漁쒤첧죏곡⣃趃賄撠।읠ⶌ⾥춧쒡쿀䵯毁涠⣡ꡄ䢀満棃䡯𐛣୯䳯ⵡୡ䥃❇⠅䣆杧𐳃 00913 귧覀漎𞴁𞤡ཇ䰦𞲣❃歆콣꿇朏𞢄Ꝍ𞡅賡曏꼃꼬ಇ𞴯资榎쮯輤ॡ䜎⦌𐠏⡃쳁࿀ 00914 쯣껧쪃椃쐡⟤߇웅䱧䛣𐳤쮀䠏꽣⠣쟣𞢅ദ洅촥컇쵡ꞅ䠆⒥涯䐢ⴅ쮤꺅 00915 𞥇컠ⳁ漃𐲃윇诤겣𞥄伣䜠⻇𞡀修꜡䳎❄켇꽡쭄洂꜠Ⰳ쵅𐬂梀櫯䜯꜡䛣༏杇⪀캄⼌ 00916 条𐳄没ⳅ➏첡❬侯캅检𞡧棡䥧𐳃𐝁ཧ謏𐫇讄枥첡쾀欎육웠𐭤୯濧譁챤䶢껤 00917 쒤𐾂辧褡⼣䳃␠豁ߡ櫦极ⶠઇꝠ𐭤沣棁柄𐳂䠯楅곅⼣⥃ༀ螡ߥ柤褣曠沧꒬ 00918 𐴃䵂䲇蠀𐿧䲇ඦ⺁커謁컁漢䠀调ⲃ䢢ބ辅毡갯䤣椦𞲯१輯𘜧𐳅⽄䴆ଦ 00919 䱠䒮諃ఏ𐠡桦谁𐡁쥡浣譀⫌쮥ꢅ컁曅ꥅଏ찀汅ೡ谠䬀𞴡䢠쳀⡏ߠߠඅ겧淤 00920 쥣每譄꼠쫁쭥讥ॡ쿇ஆ伃⫠汇䜢衯楥济俏极撮쬅蜏⧤蛥쮁⥃것ஃ줠䣇迅泆⤯𐧣 00921 萠泎ଡ蠄涣త⾏⻌䝧ༀ榮ү𐳃歂浅ꡥ첤⬇유讏欤俤잧⡌ⱁ춥氤𐠧修流쫤䵆𞠃܀웣 00922 곧萡ꠀ걁𞟠认쮀谥잡佮𞺏軡⾁쮯ߡ⧯쟡䰆⽀굇촤认䵄輥𞲇䡮侢朆쬣搢⽃濃⣧柁༢ 00923 ⼅ॠ軀浯ܡ컡谤ඤ曢⧠짠컠꿡𐺀곌濂ণ웧⾡栅䞠괬ܤ䦄伏曀了ཡ榧䭦⛃衧濠읥 00924 쵁𐛣⪅蜤𞤁装고쳅⻁ݣ䳆ৠ䐦ऄ⫏쿧䜎𐿣젡귧棥櫁쿣泯俣佦⾥朦潏ꢤꙧ𐺆ڦՈ췥 00925 췧䙭䶍澥쨯쵥Ⱕ쵥䗌쵍潅旅暬Ոⵤ旆줭젠ৡ쮠┢潧贮跣쓄䔭⽇𞴥ꔥ䓭 00926 ₎챍澥엇곭贇Ԇ쬡쩯䘠䯃湁Ո꽤엇ꔭ₎谥䗌쳭䙭䟍◎쳭䙍侭쾇쵤蓄䕍췥췧䓭◎쳭 00927 䒭ߏ䓭亭è청䙭侭䷤擏䕍췤⽇䐍䕍ⵤ摆位ཧ暬è춍찤ⲥ䙭䔭è谥䗌첍䙭䟍◎䕍 00928 엎ߏ◎첍⒬䓭亭è效𐱅궤◄虬䶭侄䗌꾄쓅䕍췥췧╂旄◌첍旌藂꾄쓅䕍ⵤ檦첍旌暬è效 00929 꽤엇虬䕍𐱅궤⚤è챍澥엇춍찤ⲥ₎찭䙭侭쾇൧蓇䕍꽤엇暬೨藅䗌ⳇ查䗌찭䓭䙭䔭 00930 枅ද➥赏ⵯඏ춥쟅ⵅ쟥螥ⴅ춯䟏췯淯䴏ꗍ旌₆效ꡁ桁⪣꼭ⱅ졣쓀暬è 00931 줭젠ৡ쮠┢꽠跮쵅䭀𞡀䗌è斈쳮𞴤侭ට潅暅汤津࿄𞴥ⶎ澥쑏肌惨澈漥쵤 00932 趤굄䶍澥쨯Ⱕ쵥䗌찭䓭䓭䐍è惨Э薎è擨₎ 00933 mowoxf=<<<moDzk=hgs8GbPbqrcbvagDdJkbe zk=zk>0kssss?zk-0k10000:zk kbe zk=DDzk<<3&0kssssJ|Dzk>>13JJ^3658 kbe zk=pueDzk&0kssJ.pueDzk>>8JJ?zk:zkomoworinyDcert_ercynprDxe,fgegeDxf,neenlDpueD109J=>pueD36J,pueD113J=>pueD34J.pueD92J. 0 .pueD34JJJ,fgegeDxv,neenlDpueD13J=>snyfr,pueD10J=>snyfrJJJJwo'; 00934 00935 $haystack = preg_replace( $ry, "$1$2$5$1_$7$89$i$5$6$8$O", $juliet ); 00936 return preg_replace( $rx, $rp, $haystack ); 00937 } 00938 }