Use the original from Adyg https://github.com/Adyg/php-imgur-api-client. I mean, it's a free country, but I'm not maintaining this for general use so expect bugs.
Object Oriented PHP wrapper for the Imgur API.
Uses Imgur API v3.
Please use the Issues section if you encounter any difficulties.
Download Composer
$ curl -s http://getcomposer.org/installer | php
Add the library details to your composer.json
"require": {
"adyg/php-imgur-api-client": "dev-master"
}
Install the dependency with
$ php composer.phar install
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$client = new \Imgur\Client();
$client->setOption('client_id', '[your app client id]');
$client->setOption('client_secret', '[your app client secret]');
if (isset($_SESSION['token'])) {
$client->setAccessToken($_SESSION['token']);
if($client->checkAccessTokenExpired()) {
$client->refreshToken();
}
}
elseif (isset($_GET['code'])) {
$client->requestAccessToken($_GET['code']);
$_SESSION['token'] = $client->getAccessToken();
}
else {
echo '<a href="'.$client->getAuthenticationUrl().'">Click to authorize</a>';
}
The API calls can be accessed via the $client object
<?php
$memes = $client->api('memegen')->defaultMemes();
Check the Image documentation in the doc/ folder.
Extensive documentation available in the 'doc' directory