Foros del Web » Programando para Internet » PHP »

Api Dropbox problema {porfavor}

Estas en el tema de Api Dropbox problema {porfavor} en el foro de PHP en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 17/08/2012, 19:55
 
Fecha de Ingreso: enero-2011
Mensajes: 112
Antigüedad: 13 años, 2 meses
Puntos: 4
Api Dropbox problema {porfavor}

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
  1. <?php
  2. include_once "src/Dropbox/OAuth/PHP.php";
  3. include_once "src/Dropbox/OAuth.php";
  4.  
  5.  
  6. /* Please supply your own consumer key and consumer secret */
  7. $consumerKey = 'zwctkx1qbhestsw';
  8. $consumerSecret = 'pqnst51045pu9kz';
  9.  
  10. include 'src/Dropbox/autoload.php';
  11.  
  12.  
  13. $oauth = new Dropbox_OAuth_PHP($consumerKey, $consumerSecret);
  14. $dropbox = new Dropbox_API($oauth);
  15.  
  16. // For convenience, definitely not required
  17. header('Content-Type: text/plain');
  18.  
  19. // We need to start a session
  20.  
  21. // There are multiple steps in this workflow, we keep a 'state number' here
  22. if (isset($_SESSION['state'])) {
  23.     $state = $_SESSION['state'];
  24. } else {
  25.     $state = 1;
  26. }
  27.  
  28. switch($state) {
  29.  
  30.     /* In this phase we grab the initial request tokens
  31.        and redirect the user to the 'authorize' page hosted
  32.        on dropbox */
  33.     case 1 :
  34.         echo "Step 1: Acquire request tokens\n";
  35.         $tokens = $oauth->getRequestToken();
  36.         print_r($tokens);
  37.  
  38.         // Note that if you want the user to automatically redirect back, you can
  39.         // add the 'callback' argument to getAuthorizeUrl.
  40.         echo "Step 2: You must now redirect the user to:\n";
  41.         echo $oauth->getAuthorizeUrl() . "\n";
  42.         $_SESSION['state'] = 2;
  43.         $_SESSION['oauth_tokens'] = $tokens;
  44.         die();
  45.  
  46.     /* In this phase, the user just came back from authorizing
  47.        and we're going to fetch the real access tokens */
  48.     case 2 :
  49.         echo "Step 3: Acquiring access tokens\n";
  50.         $oauth->setToken($_SESSION['oauth_tokens']);
  51.         $tokens = $oauth->getAccessToken();
  52.         print_r($tokens);
  53.         $_SESSION['state'] = 3;
  54.         $_SESSION['oauth_tokens'] = $tokens;
  55.         // There is no break here, intentional
  56.  
  57.     /* This part gets called if the authentication process
  58.        already succeeded. We can use our stored tokens and the api
  59.        should work. Store these tokens somewhere, like a database */
  60.     case 3 :
  61.         echo "The user is authenticated\n";
  62.         echo "You should really save the oauth tokens somewhere, so the first steps will no longer be needed\n";
  63.         print_r($_SESSION['oauth_tokens']);
  64.         $oauth->setToken($_SESSION['oauth_tokens']);
  65.         break;
  66. }
  67.  
  68. echo $dropbox->getAccountInfo();
  69. ?>

Etiquetas: derzz, dropbox
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:46.