/
firal.php
34 lines (23 loc) · 861 Bytes
/
firal.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
error_reporting(E_ALL | E_STRICT);
define('ROOT_PATH', dirname(__FILE__));
define('LIBRARY_PATH', ROOT_PATH . DIRECTORY_SEPARATOR . 'library');
$includePath = array(
LIBRARY_PATH . DIRECTORY_SEPARATOR . 'kokx',
LIBRARY_PATH . DIRECTORY_SEPARATOR . 'zend',
);
set_include_path(implode($includePath, PATH_SEPARATOR));
require_once 'Zend/Loader/Autoloader.php';
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->registerNamespace('Kokx');
// configuration
$config = require_once ROOT_PATH . DIRECTORY_SEPARATOR . 'config.php';
$client = new Kokx_Irc_Client($config['client']);
$bot = new Kokx_Irc_Bot($client, array(
'plugins' => array(
new Kokx_Irc_Bot_Plugin_GitHub($config['bot']['plugins']['github']['savefile'])
)
));
$client->sendRaw('JOIN #firal');
// connect and start listening
$client->connect();