Hola a todos estoy creando una Pagina utilizando la API de Dropbox
(
http://code.google.com/p/dropbox-php/wiki/Dropbox_API)..
pero me resulta un gran problema al implementarla en mi host:
este es el error:
Fatal error: Class 'Dropbox_OAuth' not found in /home/u149621304/public_html/src/Dropbox/OAuth/PHP.php on line 18
Yo he creado un archivo example.php
que esta en mi carpeta raiz de mi web la entrada seria esta
www.Derzz.tk/example.php
y e incluido la carpeta de Api Dropbox Php (src) en la carpeta raiz
Mi problema es qe no se que tipo de archivos llamar de la api .. o talvez el problema esta en mi hosting..
nose como saber si tengo Pear u OAuth??
ayudenme!!!
Código PHP:
Ver original<?php
include_once "src/Dropbox/OAuth/PHP.php";
include_once "src/Dropbox/OAuth.php";
/* Please supply your own consumer key and consumer secret */
$consumerKey = 'zwctkx1qbhestsw';
$consumerSecret = 'pqnst51045pu9kz';
include 'src/Dropbox/autoload.php';
$oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);
$dropbox = new Dropbox_API($oauth);
// For convenience, definitely not required
header('Content-Type: text/plain');
// We need to start a session
// There are multiple steps in this workflow, we keep a 'state number' here
if (isset($_SESSION['state'])) { $state = $_SESSION['state'];
} else {
$state = 1;
}
switch($state) {
/* In this phase we grab the initial request tokens
and redirect the user to the 'authorize' page hosted
on dropbox */
case 1 :
echo "Step 1: Acquire request tokens\n";
$tokens = $oauth->getRequestToken();
// Note that if you want the user to automatically redirect back, you can
// add the 'callback' argument to getAuthorizeUrl.
echo "Step 2: You must now redirect the user to:\n";
echo $oauth->getAuthorizeUrl() . "\n";
$_SESSION['state'] = 2;
$_SESSION['oauth_tokens'] = $tokens;
/* In this phase, the user just came back from authorizing
and we're going to fetch the real access tokens */
case 2 :
echo "Step 3: Acquiring access tokens\n";
$oauth->setToken($_SESSION['oauth_tokens']);
$tokens = $oauth->getAccessToken();
$_SESSION['state'] = 3;
$_SESSION['oauth_tokens'] = $tokens;
// There is no break here, intentional
/* This part gets called if the authentication process
already succeeded. We can use our stored tokens and the api
should work. Store these tokens somewhere, like a database */
case 3 :
echo "The user is authenticated\n";
echo "You should really save the oauth tokens somewhere, so the first steps will no longer be needed\n";
print_r($_SESSION['oauth_tokens']); $oauth->setToken($_SESSION['oauth_tokens']);
break;
}
echo $dropbox->getAccountInfo();
?>