PHP Classes

File: web/token.php

Recommend this page to a friend!
  Classes of Manuel Lemos   PHP OAuth2 Server Library   web/token.php   Download  
File: web/token.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP OAuth2 Server Library
Implements an API provider using OAuth 2 protocol
Author: By
Last change: Update of web/token.php
Date: 1 year ago
Size: 804 bytes
 

Contents

Class file image Download
<?php
/*
 * token.php
 *
 * @(#) $Id: $
 *
 */

   
define('APPLICATION_PATH', '..');

    require(
APPLICATION_PATH.'/vendor/autoload.php');

   
$options = new oauth2_server_configuration_options_class;
   
$options->application_path = APPLICATION_PATH;
   
$options->initialize();

    if(
$options->maintenance)
       
$case = new oauth2_server_maintenance_class;
    else
       
$case = new oauth2_server_token_class;
   
$case->options = $options;
    if((
$success = $case->initialize()))
       
$success = $case->finalize($case->process());
    if(
$case->exit)
        exit;
    if(
$success)
       
$case->output();
    else
    {
       
$error_case = new oauth2_server_error_class;
       
$error_case->options = $options;
       
$error_case->error = $case->error;
        if(
$error_case->initialize()
        &&
$error_case->finalize($error_case->process()))
           
$error_case->output();
    }
?>