PHP code example of phergie / phergie-irc-plugin-react-url

1. Go to this page and download the library: Download phergie/phergie-irc-plugin-react-url library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

phergie / phergie-irc-plugin-react-url example snippets


return array(

    'plugins' => array(

        // dependencies
        new \Phergie\Plugin\Dns\Plugin, // Handles DNS lookups for the HTTP plugin
        new \Phergie\Plugin\Http\Plugin, // Handles the HTTP requests for this plugin

        // configuration
        new \Phergie\Irc\Plugin\React\Url\Plugin(array(
            // All configuration is optional
            
            'hostUrlEmitsOnly' => false, // url.host.(all|<host>) emits only, no further URL handling / shortening
            
            // or

            'handler' => new \Phergie\Irc\Plugin\React\Url\DefaultUrlHandler(), // URL handler that creates a formatted message based on the URL

            // or

            'shortenTimeout' => 15 // If after this amount of seconds no url shortener has come up with a short URL the normal URL will be used. (Not in effect when there are no shorteners listening.)

            // or

            'filter' => null // Any valid filter implementing Phergie\Irc\Plugin\React\EventFilter\FilterInterface to filter which messages should be handled 

        )),

    )
);

new OrFilter([
    new UrlSectionFilter('host', '*.phergie.org'),
    new UrlSectionFilter('host', 'phergie.org'),
])

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