コード例 #1
0
<?php

/**
 * PHP Interface to v2 of the Imgur API
 * OAuth Demo: Zend Framework's Zend_Oauth
 * 
 * @author "McGlockenshire"
 * @link http://github.com/McGlockenshire/Imgur-API-for-PHP
 * @license http://www.gnu.org/licenses/lgpl-3.0.txt
 **/
error_reporting(E_ALL | E_STRICT | E_DEPRECATED);
ini_set('display_errors', true);
include_once '../Imgur.php';
Imgur::registerSPLAutoloader();
// We need an "oauth-config.php" file in the current directory.  The demo code
// ships with an "oauth-config.default.php" that must be copied and modified.
require_once __DIR__ . '/oauth-config.php';
if (!strlen(CONSUMER_KEY)) {
    die("OAuth Consumer Key not set.");
}
if (!strlen(CONSUMER_SECRET)) {
    die("OAuth Consumer Secret not set.");
}
#unset($_SESSION['oauth_state']);
if (!array_key_exists('oauth_state', $_SESSION)) {
    unset($_SESSION['token']);
    unset($_SESSION['token_secret']);
    $_SESSION['oauth_state'] = 0;
}
// You must have the Zend Framework directories in your include_path already.
// If they aren't in your include_path, update the include statement below.