PHPackages                             toin0u/concise - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. toin0u/concise

ActiveLibrary[API Development](/categories/api)

toin0u/concise
==============

Concise your urls via extern providers

v0.1(11y ago)064[4 issues](https://github.com/toin0u/concise/issues)[2 PRs](https://github.com/toin0u/concise/pulls)1MITPHPPHP &gt;=5.3.3

Since Dec 17Pushed 10y ago2 watchersCompare

[ Source](https://github.com/toin0u/concise)[ Packagist](https://packagist.org/packages/toin0u/concise)[ Docs](https://github.com/toin0u/concise)[ RSS](/packages/toin0u-concise/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (4)Used By (1)

Concise
=======

[](#concise)

[![Latest Version](https://camo.githubusercontent.com/d2797d73a77cc2703bef93ba412a61db8b71eb4c928233957251b8ace686d382/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](https://github.com/toin0u/concise/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/308bfb2cc9fd9e3c5fd104b18840b20dd678ad4c47d9c77402da67aa5d26d5f7/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/toin0u/concise)[![Code Coverage](https://camo.githubusercontent.com/8444ac4657c39ca50a3454842d2ae3659d42ec81bdf75c6a2571a79a488b4781/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/toin0u/concise)[![Quality Score](https://camo.githubusercontent.com/282ce162e793c66c5f63d8c08a0fbaa7c07a3ba61f53338375cfea2964af199c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/toin0u/concise)[![HHVM Status](https://camo.githubusercontent.com/920c8553d63b30d53af42e6848a53ad5b6cddd53e3ab7282b85d19b34570553b/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/toin0u/concise)[![Total Downloads](https://camo.githubusercontent.com/551128f9700d9470a5b8095c136262176e912f946a5568bb68e8428091f0b04f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f696e30752f636f6e636973652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/toin0u/concise)[![SensioLabsInsight](https://camo.githubusercontent.com/42827c85a2b367129e6a0e75b1b2e74d5a28e3997544501635bd990887ace921/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f32333434643733392d623935342d346339622d616531342d3138626639663039356437652f6d696e692e706e67)](https://insight.sensiolabs.com/projects/2344d739-b954-4c9b-ae14-18bf9f095d7e)

**Concise your urls via extern providers :)**

Install
-------

[](#install)

Via Composer

```
$ composer require toin0u/concise
```

Usage
-----

[](#usage)

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
$concise->shorten('http://any.url');

// Returns the expanded URL
$concise->expand('http://short.ly/1234');
```

For full list of available adapters check the official [documentation](https://github.com/egeloen/ivory-http-adapter/blob/master/doc/adapters.md).

Currently supported providers:

- Bitly
- Google
- Tinycc

### Provider chaining

[](#provider-chaining)

You can shorten a URL using multiple providers at once.

Make sure to add the `Provider`s 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);
```

### Caching

[](#caching)

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](http://www.stashphp.com/) 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);
```

Testing
-------

[](#testing)

```
$ phpspec run
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Antoine Corcy](https://github.com/toin0u)
- [Márk Sági-Kazár](https://github.com/sagikazarmark)
- [All Contributors](https://github.com/toin0u/concise/contributors)

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/37c3113877b1bf987ee92f02b70475450d873854be9bfd9b59adf35d4f3214b0?d=identicon)[toin0u](/maintainers/toin0u)

---

Top Contributors

[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (32 commits)")[![toin0u](https://avatars.githubusercontent.com/u/672421?v=4)](https://github.com/toin0u "toin0u (8 commits)")

---

Tags

urlapishortenershorten

### Embed Badge

![Health badge](/badges/toin0u-concise/health.svg)

```
[![Health](https://phpackages.com/badges/toin0u-concise/health.svg)](https://phpackages.com/packages/toin0u-concise)
```

###  Alternatives

[mremi/url-shortener

A PHP5/PHP7/PHP8 library using API to shorten/expand URL

79719.0k6](/packages/mremi-url-shortener)[mbarwick83/shorty

Google Url Shortener API Package for Laravel 5.1

31204.9k](/packages/mbarwick83-shorty)[mremi/url-shortener-bundle

Implementation of UrlShortener library for Symfony2/Symfony3

19135.0k](/packages/mremi-url-shortener-bundle)[phplicengine/bitly

Bitly API v4

22277.3k](/packages/phplicengine-bitly)[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22779.0k](/packages/m165437-laravel-blueprint-docs)[rukbat/bitly-bundle

bit.ly API bundle for symfony2

10135.2k](/packages/rukbat-bitly-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
