[Ircphpstats-devel] [CVS] Module phpstats: Change committed
Status: Inactive
Brought to you by:
mrvolta
|
From: Mr. v. <mr...@us...> - 2003-06-05 09:33:55
|
Committer : volta <mr...@us...>
CVSROOT : /cvsroot/ircphpstats
Module : phpstats
Commit time: 2003-06-05 09:33:53 UTC
Modified files:
handlers/version.php
Added files:
phpstats phpstats.php
Log message:
First beta release.
---------------------- diff included ----------------------
Index: phpstats/handlers/version.php
diff -u phpstats/handlers/version.php:1.1 phpstats/handlers/version.php:1.2
--- phpstats/handlers/version.php:1.1 Sun Mar 9 13:51:29 2003
+++ phpstats/handlers/version.php Thu Jun 5 02:33:42 2003
@@ -5,7 +5,6 @@
E-mail: <vo...@gm...>
This program is free but copyrighted software; see the file LICENSE for
details.
- $Id: version.php,v 1.1 2003/03/09 21:51:29 mrvolta Exp $
*/
$b = 1;
@@ -14,7 +13,7 @@
$parameters can be ignored
*/
define(BASE_VERSION,"PHP Stats Service");
-define(VERSION,"0.6 alpha");
+define(VERSION,"0.7 beta");
function version ($source,$parameters) {
send_to_uplink("351 " . $source . " :" . BASE_VERSION . " " . VERSION . " " . SERVERNAME);
};
Index: phpstats/phpstats
diff -u /dev/null phpstats/phpstats:1.1
--- /dev/null Thu Jun 5 02:33:53 2003
+++ phpstats/phpstats Thu Jun 5 02:33:41 2003
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Main executeable.
+# PHP Stats Service is copyright (c) 2002-2003 volta.
+# E-mail: <vo...@gm...>
+# This program is free but copyrighted software; see the file LICENSE for
+# details.
+
+server.php >phpstats.log 2>&1 &
\ No newline at end of file
Index: phpstats/phpstats.php
diff -u /dev/null phpstats/phpstats.php:1.1
--- /dev/null Thu Jun 5 02:33:53 2003
+++ phpstats/phpstats.php Thu Jun 5 02:33:41 2003
@@ -0,0 +1,53 @@
+#!/usr/bin/php -qC
+<?
+/*
+ Main application.
+ PHP Stats Service is copyright (c) 2002-2003 volta.
+ E-mail: <vo...@gm...>
+ This program is free but copyrighted software; see the file LICENSE for
+ details.
+*/
+
+set_time_limit(0);
+require("options.php"); if (!isset($a)) die("Error: Could not include options.php\n"); else unset($a);
+require("sqlfunctions.php"); if (!isset($a)) die("Error: Could not include sqlfunctions.php\n"); else unset($a);
+require("base64.php"); if (!isset($a)) die("Error: Could not include base64.php\n"); else unset($a);
+require("classes.php"); if (!isset($a)) die("Error: Counld not include classes.php\n"); else unset($a);
+require("command_handlers.php"); if (!isset($a)) die("Error: Could not include command_handlers.php\n"); else unset($a);
+
+$usernumber = 0;
+$channelnumber = 0;
+$servernumber = 0;
+
+// The socket thingy
+echo "Connecting to the uplinkserver ...\n\n";
+$socket = fsockopen(UPLINK,PORT,&$errno,&$errstr,SOCKET_TIMEOUT);
+if (!$socket) {
+ die("Could not connect to the uplink server: $errstr ($errno)\n");
+};
+
+sql_init();
+
+send_raw_to_uplink("PASS :" . PASS);
+send_raw_to_uplink("SERVER " . SERVERNAME . " 1 " . time() . " " . time() . " J10 " . SERVERNUM . MAXCLIENTS . " :" . SERVERDESC);
+
+// Add ourself to the server list :)
+$server[SERVERNUM] = new server(SERVERNAME,0,time(),time(),"P10",base64toint(MAXCLIENTS),"",SERVERDESC);
+sql_registerserver(SERVERNUM,$server[SERVERNUM]);
+sql_servernumber(++$servernumber);
+
+while (!feof($socket)) {
+ $text = fgets($socket);
+ if ($errstr) {
+ echo $errstr . "(" . $errno . ")" . "\n";
+ };
+ $array = explode("\r",$text);
+ $text = $array[0];
+ // remove all control codes, that might break debugging
+ $textdebug = ereg_replace("(\002|\003|\015|\022|\031)","",$text);
+ echo date("H:i:s") . " (In) $textdebug\n";
+ commandhandler($text);
+};
+fclose($socket);
+sql_die();
+?>
\ No newline at end of file
----------------------- End of diff -----------------------
|