3 $wgExtensionFunctions[] = "wfShowProcesslist";
5 function wfShowProcesslist() {
7 require_once( 'includes/SpecialPage.php' );
9 class ShowProcesslistPage
extends UnlistedSpecialPage
11 function ShowProcesslistPage() {
12 UnlistedSpecialPage
::UnlistedSpecialPage("ShowProcesslist");
15 function execute( $par ) {
16 global $wgRequest, $wgOut, $wgTitle, $wgUser;
19 if ( !$wgUser->isDeveloper() ) {
20 $wgOut->addWikiText( "You're not allowed, go away" );
24 $res=wfQuery("SHOW FULL PROCESSLIST",DB_READ
);
26 $output = '<table border="1">';
27 while ( $row=wfFetchObject($res)){
29 $fields = get_object_vars($row);
30 foreach ($fields as $name => $value ) {
31 $output .= "<td>" . htmlspecialchars( $value ) . "</td>";
35 $output .= "</table>";
36 $wgOut->addHTML( $output );
41 SpecialPage
::addPage( new ShowProcesslistPage
);
43 } # End of extension function