format
[PHP-P10.git] / Bots / Stats.class.php
index 3288d85b019c34aa44c8c2908a968c10b37fd5a2..ec4e2fb349c456d2beabc34e68796823a538749f 100644 (file)
@@ -6,7 +6,7 @@
  * it under the terms of the GNU General Public License as published by *
  * the Free Software Foundation, either version 3 of the License, or    *
  * (at your option) any later version.                                  *
- *                                                                      * 
+ *                                                                      *
  * This program is distributed in the hope that it will be useful,      *
  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
@@ -16,7 +16,7 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
  *                                                                      *
  ************************************************************************
- * 
+ *
  *  Bots/Stats.class.php
  *
  * RRD Stats module...
@@ -26,7 +26,7 @@
 class {$_NAME} extends Bot {
        private $uplink;
        private $timer;
-       
+
        public function load($uplink, $old = false) {
                $this->uplink = $uplink;
                if(!file_exists("db/network.rrd")) {
@@ -45,13 +45,13 @@ class {$_NAME} extends Bot {
                                "RRA:MAX:0.5:6:700",
                                "RRA:MAX:0.5:24:775",
                                "RRA:MAX:0.5:288:797"
-                       );
-                       $ret = rrd_create($fname, $opts, count($opts));
-                       if(!$ret) {
-                               $err = rrd_error();
-                               echo "Create error: $err\n";
-                               die();
-                       }
+                               );
+                               $ret = rrd_create($fname, $opts, count($opts));
+                               if(!$ret) {
+                                       $err = rrd_error();
+                                       echo "Create error: $err\n";
+                                       die();
+                               }
                }
                if(!file_exists("db/network-away.rrd")) {
                        $fname = "db/network-away.rrd";
@@ -67,13 +67,13 @@ class {$_NAME} extends Bot {
                                "RRA:MAX:0.5:6:700",
                                "RRA:MAX:0.5:24:775",
                                "RRA:MAX:0.5:288:797"
-                       );
-                       $ret = rrd_create($fname, $opts, count($opts));
-                       if(!$ret) {
-                               $err = rrd_error();
-                               echo "Create error: $err\n";
-                               die();
-                       }
+                               );
+                               $ret = rrd_create($fname, $opts, count($opts));
+                               if(!$ret) {
+                                       $err = rrd_error();
+                                       echo "Create error: $err\n";
+                                       die();
+                               }
                }
                if(!file_exists("db/network-peruser.rrd")) {
                        $fname = "db/network-peruser.rrd";
@@ -89,21 +89,21 @@ class {$_NAME} extends Bot {
                                "RRA:MAX:0.5:6:700",
                                "RRA:MAX:0.5:24:775",
                                "RRA:MAX:0.5:288:797"
-                       );
-                       $ret = rrd_create($fname, $opts, count($opts));
-                       if(!$ret) {
-                               $err = rrd_error();
-                               echo "Create error: $err\n";
-                               die();
-                       }
+                               );
+                               $ret = rrd_create($fname, $opts, count($opts));
+                               if(!$ret) {
+                                       $err = rrd_error();
+                                       echo "Create error: $err\n";
+                                       die();
+                               }
                }
                $this->timer = timer(5,array(&$this,"create_stats"),array());
        }
-       
+
        public function unload($rehash = false) {
                kill_timer($this->timer);
        }
-       
+
        function create_stats() {
                $this->timer = timer(5*60,array(&$this,"create_stats"),array());
                $stats = array(
@@ -146,13 +146,13 @@ class {$_NAME} extends Bot {
                                        "RRA:MAX:0.5:6:700",
                                        "RRA:MAX:0.5:24:775",
                                        "RRA:MAX:0.5:288:797"
-                               );
-                               $ret = rrd_create($fname, $opts, count($opts));
+                                       );
+                                       $ret = rrd_create($fname, $opts, count($opts));
                        }
                        rrd_update($fname, time().":".$count);
                }
        }
-       
+
 }
 
 ?>
\ No newline at end of file