Example #1
0
$config = new SimpleXMLElement($_config);
if ( !$config )
{
	echo "Error! Could not parse XML file.";
	die();
}


$module_config = array();
foreach ( $config->module as $mod )
{
	if ( file_exists("modules/".$mod['name']."/".$mod['name'].".php") )
	{
		include("modules/".$mod['name']."/".$mod['name'].".php");
		$module_config = array_merge(call_user_func($mod['name']."_config"), $module_config);
	}
}

include "parse.php";
include "modemgr.php";

include "irc.php";


$phpirc = new ircbot;

$phpirc->init($config, $module_config);
$phpirc->mainloop();

?>
Example #2
0
<?php

set_time_limit(0);
ini_set('display_errors', 'on');
try {
    $systemroot = dirname(__FILE__);
    if (!chdir($systemroot)) {
        throw new Exception('No se pudo cambiar de directorio a ' . $systemroot);
    }
    if (!(include_once "init.php")) {
        throw new Exception('No se pudo encontrar el archivo de inicialización.');
    }
    $irc = new ircbot();
    $irc->run();
    $dbh = null;
} catch (Exception $e) {
    print "Ocurrió un error durante la ejecucion: " . $e->getMessage();
}
echo "\n";