2 # Not a valid entry point, skip unless MEDIAWIKI is defined
3 if (defined('MEDIAWIKI')) {
5 $wgExtensionFunctions[] = "wfShowProcesslist";
7 function wfShowProcesslist() {
9 require_once( "$IP/includes/SpecialPage.php" );
11 class ShowProcesslistPage
extends UnlistedSpecialPage
13 function ShowProcesslistPage() {
14 UnlistedSpecialPage
::UnlistedSpecialPage("ShowProcesslist");
17 function execute( $par ) {
18 global $wgRequest, $wgOut, $wgTitle, $wgUser;
21 if ( !$wgUser->isDeveloper() ) {
22 $wgOut->addWikiText( "You're not allowed, go away" );
26 $res=wfQuery("SHOW FULL PROCESSLIST",DB_READ
);
28 $output = '<table border="1">';
29 while ( $row=wfFetchObject($res)){
31 $fields = get_object_vars($row);
32 foreach ($fields as $name => $value ) {
33 $output .= "<td>" . htmlspecialchars( $value ) . "</td>";
37 $output .= "</table>";
38 $wgOut->addHTML( $output );
43 SpecialPage
::addPage( new ShowProcesslistPage
);
45 } # End of extension function
46 } # End of invocation guard