rendered paste body<?php/* * Created on 30-Aug-2006 * * Peter Morgan - pedromorgan@gmail.com * */ class debugger extends module { var $mode = USER; var $trigger = 'debug'; var $command = PRIVMSG; //var $help = 'Join a channel. Usage .join <#channels list>'; //var $usage = 'Usage .join <#channels list>'; var $unloadable = false; var $help = 'Outputs debug info.'; var $usage = 'Usage: !debug [modconf, mem, buffer, ircstat, env, files]'; var $_cmd; function init(){ $this->_cmd = array('modconf','mem', 'buffer','ircstat','env','files'); echo "INIT DEBUGGER\n"; } function call(){ if($this->arguments){ $str = ''; if(in_array($this->args[1],$this->_cmd) ){ switch($this->args[1]){ case 'modconf': $str = 'Files'; break; case 'buffer': //$str = print_r($this->buffer,true); foreach($this->buffer as $k => $v){ $str .= "[$k]=>$v, "; } break; case 'files': //print_r($this->__bot->fileHandler->_current_file); foreach($this->__bot->fileHandler->_current_file as $log => $file){ $str .= "[$log]=>$file, "; } break; case 'env': foreach($_ENV as $k => $v){ $str .= "[$k]=>$v, "; } break; case 'mem': $str = memory_get_usage(); break; } // end switch }else{ $str = 'OOPS'; } //$this->send($str); } $this->send($str); } }?>