cvs: pearbot /modules bugstats.php
[email protected] ("Tobias Schlitt") Sun, 27 Jun 2004 05:59:30 -0000
| Newsgroups | php.pear.bot |
|---|---|
| Message-ID | <cvstoby1088315970@cvsserver> |
toby Sun Jun 27 01:59:30 2004 EDT
Modified files:
/pearbot/modules bugstats.php
Log:
* Regex more flexible.
* Moved timeout for refetching bugcount.
* Fixed timout to be 15 minutes, not 1.5.
http://cvs.php.net/diff.php/pearbot/modules/bugstats.php?r1=1.5&r2=1.6&ty=u
Index: pearbot/modules/bugstats.php
diff -u pearbot/modules/bugstats.php:1.5 pearbot/modules/bugstats.php:1.6
--- pearbot/modules/bugstats.php:1.5 Sat Jun 26 15:51:16 2004
+++ pearbot/modules/bugstats.php Sun Jun 27 01:59:29 2004
@@ -1,9 +1,9 @@
<?php
/**
- * $Id: bugstats.php,v 1.5 2004/06/26 19:51:16 toby Exp $
- * $Revision: 1.5 $
+ * $Id: bugstats.php,v 1.6 2004/06/27 05:59:29 toby Exp $
+ * $Revision: 1.6 $
* $Author: toby $
- * $Date: 2004/06/26 19:51:16 $
+ * $Date: 2004/06/27 05:59:29 $
*
* Copyright (c) 2004 Tobias Schlitt <[email protected]> & Mirco Bauer <[email protected]>
*/
@@ -18,6 +18,7 @@
var $license = 'LGPL';
var $lastCount = 0;
+ var $timeOut = 900000;
var $timeids = array();
var $actionids = array();
@@ -25,7 +26,7 @@
function module_init(&$irc)
{
$this->actionids[] = $irc->registerActionhandler(SMARTIRC_TYPE_CHANNEL|SMARTIRC_TYPE_QUERY|SMARTIRC_TYPE_NOTICE, '^!bugstats', $this, 'bugstats');
- $this->timeids[] = $irc->registerTimehandler(90000, $this, 'autoBugstats');
+ $this->timeids[] = $irc->registerTimehandler($this->timeout, $this, 'autoBugstats');
}
function module_exit(&$irc)
@@ -55,8 +56,8 @@
}
$chan = $irc->getChannel('#pear');
$topic = $chan->topic;
- $topic = preg_replace('/\| [0-9]+ open bugs/isU', '', $topic);
- $irc->setTopic('#pear', $topic.'| '.$count.' open bugs');
+ $topic = preg_replace('/[\| ]*[0-9]+ open bugs/isU', '', $topic);
+ $irc->setTopic('#pear', $topic.' | '.$count.' open bugs');
return true;
}