bnbwebexpertise/linkr-php-client

There is no license information available for the latest version (1.0.5) of this package.

Linkr PHP client lib

1.0.5 2020-04-03 14:38 UTC

This package is auto-updated.

Last update: 2024-04-29 03:27:04 UTC


README

For https://github.com/LINKIWI/linkr

Usage

$client = new \Bnb\Linkr\Client('https://linkr.foo.bar', 'MyApiKey');

// Create a link - Returns a Bnb\Linkr\ShortUrl
$link = $client->shorten('https://foo.bar/with/a/very/long/url');

// Get link info - Returns a Bnb\Linkr\ShortUrl
$link = $client->info('myAlias');

// Delete a link by alias
$client->delete($link->alias);

If behind a proxy, configure once at runtim :

// Anonymous
Linkr::setHttpProxy('http://10.10.10.10');

// Authenticated
Linkr::setHttpProxy('http://10.10.10.10', 'user', 'password');