phergie/phergie-irc-bot-react

View on GitHub
bin/phergie

Summary

Maintainability
Test Coverage
#!/usr/bin/env php
<?php
/**
 * Phergie (http://phergie.org)
 *
 * @link http://github.com/phergie/phergie-irc-bot-react for the canonical source repository
 * @copyright Copyright (c) 2008-2014 Phergie Development Team (http://phergie.org)
 * @license http://phergie.org/license Simplified BSD License
 * @package Phergie\Irc\Bot\React
 */

if (!isset($argv)) {
    trigger_error('Please enable register_argc_argv in your PHP configuration', E_USER_ERROR);
}

set_include_path(implode(PATH_SEPARATOR, array(
    get_include_path(),
    __DIR__ . '/../vendor', // for bin/ when invoked from git repo clone
    __DIR__ . '/../../..',  // for vendor/bin when installed via Composer
)));
require 'autoload.php';

$configFile = isset($argv[1]) ? $argv[1] : 'config.php';
$config = require $configFile;

$bot = new \Phergie\Irc\Bot\React\Bot;
$bot->setConfig($config);
$bot->run();