Get support for toin0u/concise
If you're new to LTH, please see our FAQ for more information on what it is we do.
Support Options
Unfortunately, there are currently no active helpers for this repository on the platform. Until they become available, we reccomend the following actions:
View Open IssuesTake a look to see if anyone else has experienced the same issue as you and if they managed to solve it.
Open an IssueMake sure to read any relevant guidelines for opening issues on this repo before posting a new issue.
Sponsor directlyCheck out the page and see if there are any options to sponsor this project or it's developers directly.
toin0u/concise
Concise
Concise your urls via extern providers :)
Install
Via Composer
$ composer require toin0u/concise
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.
Currently supported providers:
- Bitly
- Tinycc
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
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);
Testing
$ phpspec run
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.
Our Mission
We want to make open source more sustainable. The entire platform was born from this and everything we do is in aid of this.
From the Blog
Interesting Articles
-
Generating income from open source
Jun 23 • 8 min read
-
2023 State of OSS
Apr 23 • 45 min read ★
-
A funding experiment...
Aug 19 • 10 min read
-
But You Said I could
Aug 19 • 2 min read
Thank you for checking out LiveTechHelper |
2025 © lth-dev incorporated
p-e622a1a2