Home  |  Linux  | Mysql  | PHP  | XML
From:Mirco 'meebey' Bauer Date:Sun Jun 27 11:06:14 2004
Subject:cvs: pearbot /modules bugstats.php
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
Navigate in group php.pear.bot at sever news.php.net
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by Zareef Ahmed
Powered By PHP Consultants