Concise your urls via extern providers

v0.1 2014-12-17 22:00 UTC

This package is auto-updated.

Last update: 2024-06-24 03:30:01 UTC



Latest Version Software License Build Status Code Coverage Quality Score HHVM Status Total Downloads SensioLabsInsight

Concise your urls via extern providers :)


Via Composer

$ composer require toin0u/concise


Simple example using Google provider:

use Concise\Concise;
use Concise\Provider\Google;
use Ivory\HttpAdapter\GuzzleHttpAdapter;

$concise = new Concise(new Google(new GuzzleHttpAdapter));

// Returns the shortened URL

// Returns the expanded URL

For full list of available adapters check the official documentation.

Currently supported providers:

  • Bitly
  • Google
  • Tinycc

Provider chaining

You can shorten a URL using multiple providers at once.

Make sure to add the Providers in the chain in the SAME ORDER for both shortening and expanding. Expanding is automatically done in a reversed order.

use Concise\Concise;
use Concise\Provider\Chain;

$chain = new Chain;

$chain->addProvider(/* add a Provider instance here */);
$chain->addProvider(/* add another Provider instance here */);

$concise = new Concise($chain);


When working with lots of URLs it probably makes sense to cache already shortened/expanded URLs. This way you can avoid unnecessary HTTP requests.

To use caching install Stash first:

$ composer require tedivm/stash
use Concise\Concise;
use Concise\Provider\Cache;
use Stash\Pool;

$cache = new Cache(/* add a Provider instance here */, new Pool);
$concise = new Concise($cache);


$ phpspec run


Please see CONTRIBUTING for details.



The MIT License (MIT). Please see License File for more information.