cvs: pearbot /modules bugstats.php

From: Date: Sun, 27 Jun 2004 17:06:14 +0000
Subject: cvs: pearbot /modules bugstats.php
Groups: php.pear.bot 
Request: Send a blank email to pear-bot+get-47@lists.php.net to get a copy of this message
meebey Sun Jun 27 13:06:14 2004 EDT Modified files: /pearbot/modules bugstats.php Log: - minor fixes (including PEAR CS) http://cvs.php.net/diff.php/pearbot/modules/bugstats.php?r1=1.6&r2=1.7&ty=u Index: pearbot/modules/bugstats.php diff -u pearbot/modules/bugstats.php:1.6 pearbot/modules/bugstats.php:1.7 --- pearbot/modules/bugstats.php:1.6 Sun Jun 27 01:59:29 2004 +++ pearbot/modules/bugstats.php Sun Jun 27 13:06:14 2004 @@ -1,9 +1,9 @@ <?php /** - * $Id: bugstats.php,v 1.6 2004/06/27 05:59:29 toby Exp $ - * $Revision: 1.6 $ - * $Author: toby $ - * $Date: 2004/06/27 05:59:29 $ + * $Id: bugstats.php,v 1.7 2004/06/27 17:06:14 meebey Exp $ + * $Revision: 1.7 $ + * $Author: meebey $ + * $Date: 2004/06/27 17:06:14 $ * * Copyright (c) 2004 Tobias Schlitt <toby@php.net> & Mirco Bauer <meebey@php.net> */ @@ -18,10 +18,10 @@ var $license = 'LGPL'; var $lastCount = 0; - var $timeOut = 900000; + var $timeout = 900000; - var $timeids = array(); var $actionids = array(); + var $timeids = array(); function module_init(&$irc) { @@ -42,14 +42,15 @@ $count = $this->getStats(); if (PEAR::isError($count) || !$count) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $count->getMessage()); - return $count; + return false; } $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $data->nick.': Current bug count is '.$count); - $this->autoBugstats($irc); + $this->updateTopic($irc); return true; } - function autoBugstats (&$irc) { + function updateTopic(&$irc) + { $count = $this->getStats(); if (PEAR::isError($count) || !$count) { return $count; @@ -61,17 +62,18 @@ return true; } - function getStats ( ) { + function getStats() + { $req =& new HTTP_Request('http://pear.php.net/bugs/lstat.php'); if (PEAR::isError($req->sendRequest())) { return PEAR::raiseError('Error fetching bug stats.', 0); } $data = (int)$req->getResponseBody(); - if ($this->lastCount =! $data) { + if ($this->lastCount != $data) { $this->lastCount = $data; return $data; } return false; } } -?> +?> \ No newline at end of file

« previous php.pear.bot (#47) next »