No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
sample
src
tests
.gitignore
LICENSE
README.md
composer.json
composer.lock
phpunit.xml

README.md

ewgra/phergie-irc-plugin-react-http-status-checker

Phergie plugin for checking http status for url and send notification.

Install

The recommended method of installation is through composer.

composer require ewgra/phergie-irc-plugin-react-http-status-checker

See Phergie documentation for more information on installing and enabling plugins.

Configuration

// Connection
$connection = new \Phergie\Irc\Connection(array(
    'serverHostname' => 'irc.freenode.net',
    'username' => 'Phergiebot',
    'realname' => 'Phergiebot',
    'nickname' => 'Phergiebot'
));

return [
    'plugins' => [
        // configuration
        new \ewgRa\Phergie\Plugin\React\HttpStatusChecker\Plugin([
            // Required: guzzle http client that will be used for http requests
            'httpClient' => new \Guzzle\Http\Client(),

            // Required: list of channels and nicknames that will be notified
            'targets' => [
                $connection->getMask() => [
                    'ewgra',
                ],
                // ...
            ],

            // Required: list of urls that will be checked and expected status codes
            'urls' => [
                // url => [expectedcode1, .., expectedcoden]
                "http://foo.bar" => [200],
                "http://foobar.foobar" => [302]
            ],

            // Optional: interval for checking in seconds (default 300)
            'interval' => 300,

            // Optional: formater to show customized notify, instance of FormatterInterface
            'formatter' => new DefaultFormatter(),
        ])
    ],
    'connections' => [$connection],
];

Tests

To run the unit test suite:

curl -s https://getcomposer.org/installer | php
php composer.phar install
./vendor/bin/phpunit

License

Released under the BSD License. See LICENSE.