Skip to content
Phergie plugin for providing URL shortening services
PHP
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

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

pschwisow/phergie-irc-plugin-react-url-shorten

Phergie plugin to provide URL shortening services for Url plugin (and others).

Build Status Code Climate Test Coverage

Install

The recommended method of installation is through composer.

{
    "require": {
        "pschwisow/phergie-irc-plugin-react-url-shorten": "^2"
    }
}

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

Configuration

return [
    'plugins' => [
        // 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
        new \Phergie\Irc\Plugin\React\Url\Plugin([
            'handler' => new \Phergie\Irc\Plugin\React\Url\DefaultUrlHandler('[%url-short%] %composed-title%')
        ]), // Emits url.shorten.* events

        // configuration
        new \PSchwisow\Phergie\Plugin\UrlShorten\Plugin([
            // All configuration is optional

            // Specify the classname of the shortener adapter
            'service' => 'Gscio', // FQCN or relative to PSchwisow\Phergie\Plugin\UrlShorten\Adapter

            // Override adapter's minimum length to attempt to shorten
            'minimumLength' => 15,

            // Add to list of hosts to skip shortening (presumably because they are already shortened)
            'skipHosts' => ['abc.com', 'xyz.net']

            // Disable the default list of hosts to skip shortening
            'disableDefaultSkipHosts' => true
        ])
    ]
];

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.

You can’t perform that action at this time.