diff options
author | Brion Vibber <brion@users.mediawiki.org> | 2004-11-20 10:29:46 +0000 |
---|---|---|
committer | Brion Vibber <brion@users.mediawiki.org> | 2004-11-20 10:29:46 +0000 |
commit | 7fe27aca0eec88ac28e53f7babeacc87c09bd043 (patch) | |
tree | 74687de273ebbc9cdc18740018a957d2b1013802 /extensions | |
parent | 941a095963a1a9f8c5ac68491bf2032db04589ed (diff) | |
download | mediawikicore-7fe27aca0eec88ac28e53f7babeacc87c09bd043.tar.gz mediawikicore-7fe27aca0eec88ac28e53f7babeacc87c09bd043.zip |
Move some misplaced extensions from main MediaWiki module to extensions
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/6302
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/MakeDBError.php | 25 | ||||
-rw-r--r-- | extensions/ShowProcesslist.php | 47 | ||||
-rw-r--r-- | extensions/SiteMatrix.php | 102 | ||||
-rw-r--r-- | extensions/UnicodeConverter.php | 53 |
4 files changed, 0 insertions, 227 deletions
diff --git a/extensions/MakeDBError.php b/extensions/MakeDBError.php deleted file mode 100644 index ce87f3d3c0a2..000000000000 --- a/extensions/MakeDBError.php +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -$wgExtensionFunctions[] = "wfMakeDBErrorExt"; - -function wfMakeDBErrorExt() { - -require_once( "includes/SpecialPage.php" ); - -class MakeDBErrorPage extends UnlistedSpecialPage -{ - function MakeDBErrorPage() { - UnlistedSpecialPage::UnlistedSpecialPage("MakeDBError"); - } - - function execute( $par ) { - $this->setHeaders(); - wfQuery( "test", DB_READ ); - } -} - -SpecialPage::addPage( new MakeDBErrorPage ); - -} # End of extension function - -?> diff --git a/extensions/ShowProcesslist.php b/extensions/ShowProcesslist.php deleted file mode 100644 index 23f159784ee9..000000000000 --- a/extensions/ShowProcesslist.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -# Not a valid entry point, skip unless MEDIAWIKI is defined -if (defined('MEDIAWIKI')) { - -$wgExtensionFunctions[] = "wfShowProcesslist"; - -function wfShowProcesslist() { -global $IP; -require_once( "$IP/includes/SpecialPage.php" ); - -class ShowProcesslistPage extends UnlistedSpecialPage -{ - function ShowProcesslistPage() { - UnlistedSpecialPage::UnlistedSpecialPage("ShowProcesslist"); - } - - function execute( $par ) { - global $wgRequest, $wgOut, $wgTitle, $wgUser; - - $this->setHeaders(); - if ( !$wgUser->isDeveloper() ) { - $wgOut->addWikiText( "You're not allowed, go away" ); - return; - } - - $res=wfQuery("SHOW FULL PROCESSLIST",DB_READ); - $output=array(); - $output = '<table border="1">'; - while ( $row=wfFetchObject($res)){ - $output .= "<tr>"; - $fields = get_object_vars($row); - foreach ($fields as $name => $value ) { - $output .= "<td>" . htmlspecialchars( $value ) . "</td>"; - } - $output .= "</tr>"; - } - $output .= "</table>"; - $wgOut->addHTML( $output ); - - } -} - -SpecialPage::addPage( new ShowProcesslistPage ); - -} # End of extension function -} # End of invocation guard -?> diff --git a/extensions/SiteMatrix.php b/extensions/SiteMatrix.php deleted file mode 100644 index aa25a832d256..000000000000 --- a/extensions/SiteMatrix.php +++ /dev/null @@ -1,102 +0,0 @@ -<?php - -# Make an HTML table showing all the wikis on the site - -# Not a valid entry point, skip unless MEDIAWIKI is defined -if (defined('MEDIAWIKI')) { - -$wgExtensionFunctions[] = "wfSiteMatrix"; - -function wfSiteMatrix() { -global $IP; -require_once( "$IP/includes/SpecialPage.php" ); - -class SiteMatrixPage extends SpecialPage -{ - function SiteMatrixPage() { - SpecialPage::SpecialPage("SiteMatrix"); - } - - function execute( $par ) { - global $wgRequest, $wgOut, $wgTitle, $wgLocalDatabases; - $this->setHeaders(); - - $langlist = array_map( 'trim', file( '/home/wikipedia/common/langlist' ) ); - sort( $langlist ); - $xLanglist = array_flip( $langlist ); - - $sites = array( 'wiki', 'wiktionary', 'wikibooks', 'wikiquote' ); - $names = array( - 'wiki' => 'Wikipedia<br />w', - 'wiktionary' => 'Wiktionary<br />wikt', - 'wikibooks' => 'Wikibooks<br />b', - 'wikiquote' => 'Wikiquote<br />q' - ); - $hosts = array( - 'wiki' => 'wikipedia.org', - 'wiktionary' => 'wiktionary.org', - 'wikibooks' => 'wikibooks.org', - 'wikiquote' => 'wikiquote.org' - ); - - # Tabulate the matrix - $specials = array(); - $matrix = array(); - foreach( $wgLocalDatabases as $db ) { - # Find suffix - foreach ( $sites as $site ) { - if ( preg_match( "/(.*)$site\$/", $db, $m ) ) { - $lang = $m[1]; - if ( empty( $xLanglist[$lang] ) && $site == 'wiki' ) { - $specials[] = $lang; - } else { - $matrix[$site][$lang] = 1; - } - break; - } - } - } - - # Construct the HTML - - # Header row - $s = "<table><tr>"; - foreach ( $names as $name ) { - $s .= "<td><strong>$name</strong></td>"; - } - $s .= "</tr>\n"; - - # Bulk of table - foreach ( $langlist as $lang ) { - $s .= "<tr>"; - foreach ( $names as $site => $name ) { - $url = "http://$lang." . $hosts[$site] . "/"; - if ( empty( $matrix[$site][$lang] ) ) { - # Non-existent wiki - $s .= "<td><a href=\"$url\" class=\"new\">$lang</a></td>"; - } else { - # Wiki exists - $s .= "<td><a href=\"$url\">$lang</a></td>"; - } - } - $s .= "</tr>\n"; - } - $s .= "</table>\n"; - - # Specials - $s .= "<ul>"; - foreach ( $specials as $lang ) { - $s .= "<li><a href=\"http://$lang.wikipedia.org/\">$lang</a></li>\n"; - } - $s .= "</ul>"; - $wgOut->addHTML( $s ); - } -} - -SpecialPage::addPage( new SiteMatrixPage ); -global $wgMessageCache; -$wgMessageCache->addMessage( "sitematrix", "List of Wikimedia wikis" ); - -} # End of extension function -} # End of invocation protection -?> diff --git a/extensions/UnicodeConverter.php b/extensions/UnicodeConverter.php deleted file mode 100644 index 7ab7fe3cb468..000000000000 --- a/extensions/UnicodeConverter.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -# This is a simple example of a special page module -# Given a string in UTF-8, it converts it to HTML entities suitable for -# an ISO 8859-1 web page. - -# Not a valid entry point, skip unless MEDIAWIKI is defined -if (defined('MEDIAWIKI')) { -$wgExtensionFunctions[] = "wfUnicodeConverter"; - -function wfUnicodeConverter() { -global $IP; -require_once( "$IP/includes/SpecialPage.php" ); - -class UnicodeConverter extends SpecialPage -{ - function UnicodeConverter() { - SpecialPage::SpecialPage("UnicodeConverter"); - } - - function execute( $par ) { - global $wgRequest, $wgOut, $wgTitle; - - $this->setHeaders(); - - $q = $wgRequest->getText( 'q' ); - $encQ = htmlspecialchars( $q ); - $action = $wgTitle->escapeLocalUrl(); - $ok = htmlspecialchars( wfMsg( "ok" ) ); - - $wgOut->addHTML( <<<END -<form name="ucf" method="post" action="$action"> -<textarea rows="15" cols="80" name="q">$encQ</textarea><br /> -<input type="submit" name="submit" value="$ok" /><br /><br /> -</form> -END -); - - if ( !is_null( $q ) ) { - $html = wfUtf8ToHTML( htmlspecialchars( $q ) ); - $wgOut->addHTML( "\n\n\n" . nl2br( $html ) . "\n<hr />\n" . - nl2br( htmlspecialchars( $html ) ) . "\n\n" ); - } - } -} - -global $wgMessageCache; -SpecialPage::addPage( new UnicodeConverter ); -$wgMessageCache->addMessage( "unicodeconverter", "Unicode Converter" ); - -} # End of extension function -} # End of invocation guard -?> |