IRC notifier
This commit is contained in:
@@ -12,7 +12,7 @@ class DBH
|
||||
|
||||
function log($line)
|
||||
{
|
||||
//return;
|
||||
return;
|
||||
static $f = false;
|
||||
static $failed = false;
|
||||
|
||||
@@ -54,8 +54,8 @@ class DBH
|
||||
}
|
||||
|
||||
|
||||
$this->query("SET SQL_MODE='TRADITIONAL'");
|
||||
$this->query("SET NAMES 'utf8'");
|
||||
//$this->query("SET SQL_MODE='TRADITIONAL'");
|
||||
$this->query("SET NAMES 'utf8'");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
27
htdocs/lib/IRCNotify.php
Normal file
27
htdocs/lib/IRCNotify.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class IRCNotify
|
||||
{
|
||||
function http_post($url, $fields)
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
$res = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function send($chan, $msg)
|
||||
{
|
||||
$fields = array(
|
||||
"chan" => $chan,
|
||||
"auth" => file_get_contents(SITE_ROOT . '/lib/irc_passwd'),
|
||||
"msg" => $msg
|
||||
);
|
||||
|
||||
self::http_post("http://messi.streamgrid.net/~lkalif/lolabot.php", $fields);
|
||||
}
|
||||
}
|
||||
@@ -52,5 +52,5 @@ create table reports(
|
||||
crash_reason varchar(128),
|
||||
crash_address varchar(16),
|
||||
crash_thread integer,
|
||||
raw_stacktrace text
|
||||
raw_stacktrace longtext
|
||||
);
|
||||
Reference in New Issue
Block a user