Phergie plugin for verifying that the client connection has not been dropped by sending self CTCP PINGs after periods of inactivity.
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.
src
tests
.gitignore
.travis.yml
LICENSE
README.md
composer.json
composer.lock
phpunit.xml

README.md

renegade334/phergie-irc-plugin-react-ping

Phergie plugin for verifying that the client connection has not been dropped by sending self CTCP PINGs after periods of inactivity.

If the ping is not received within a given timeout period, the plugin tells the client to disconnect the connection.

Build Status

Install

The recommended method of installation is through composer.

{
    "require": {
        "renegade334/phergie-irc-plugin-react-ping": "dev-master"
    }
}

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

Configuration

return [
    'plugins' => [
        // configuration
        new \Renegade334\Phergie\Plugin\React\Ping\Plugin([
            // Optional: the number of seconds of inactivity before a PING is sent (default: 90)
            'wait' => 90,

            // Optional: the number of seconds to wait for a PING response before disconnecting (default: 20)
            'timeout' => 20,
        ])
    ]
];

The plugin is written such that it honours being filtered by a ConnectionFilter if desired.

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.