[Squalk-cvs] ircbot/lib functions.php,1.3,1.4
Status: Inactive
Brought to you by:
mkavanagh
From: Matthew K. <mka...@us...> - 2005-09-27 21:03:34
|
Update of /cvsroot/squalk/ircbot/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21068/lib Modified Files: functions.php Log Message: What the hell did I have this for anyway? Great job, genius, include a file for ONE CONSTANT Index: functions.php =================================================================== RCS file: /cvsroot/squalk/ircbot/lib/functions.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** functions.php 1 May 2004 14:06:51 -0000 1.3 --- functions.php 27 Sep 2005 21:03:23 -0000 1.4 *************** *** 18,27 **** # # $Id$ - function panic($message, $dump_globals = true) { - if($dump_globals) { - var_dump($GLOBALS); - } - die("******\nPANIC: ".$message."\n******"); - } function get_config($files) { --- 18,21 ---- *************** *** 51,99 **** } } ! } ! ! function parse_command($data) { ! $data = explode(' ', str_replace("\r", '', str_replace("\n", '', $data))); ! ! $command = array(); ! ! $data[0] = str_replace(':', '', $data[0]); ! ! if(strrpos($data[0], '!') === FALSE) { ! $command['type'] = 'server'; ! $command['nick'] = NULL; ! $command['user'] = NULL; ! $command['host'] = $data[0]; ! } ! else { ! $command['type'] = 'user'; ! $data[0] = explode('!', $data[0]); ! $command['nick'] = $data[0][0]; ! $data[0][1] = explode('@', $data[0][1]); ! $command['user'] = $data[0][1][0]; ! $command['host'] = $data[0][1][1]; ! } ! ! unset($data[0]); ! ! $command['command'] = $data[1]; ! ! unset($data[1]); ! ! $command['params'] = array(); ! ! foreach($data as $index => $datum) { ! if($datum{0} === ':') { ! break; ! } ! else { ! $command['params'][] = $datum; ! unset($data[$index]); ! } ! } ! ! $command['params'][] = substr(implode(' ', $data), 1); ! ! return $command; ! } ! ?> \ No newline at end of file --- 45,47 ---- } } ! } \ No newline at end of file |