public function process()
    {
        // Check if we should verify the request
        if ($this->configuration->getUseAuthorization()) {
            if (
                $this->uri != '/token' &&
                $this->uri != '/authorize' &&
                !$this->tokenServer->verifyResourceRequest(\OAuth2\Request::createFromGlobals())
            ) {
                // Get the data as json and convert it to an array,
                // - so we can set our own response type.
                $data = $this->tokenServer->getResponse()->getResponseBody('json');
                $data = json_decode($data, true);

                // Set the response, status code and output content setting final output to true
                $this->response = $data;
                $this->statusCode = $this->tokenServer->getResponse()->getStatusCode();
                $this->output(true);
                return $this;
            }
        }

        try {
            // Handle OPTIONS requests
            if ($this->method == 'options') {
                $this->handleOptionsRequest();
            } else {
                // Execute the router
                $this->router->execute();
            }
        } catch (\Exception $e) {
            // Set the response and status code to error
            $this->response = ['error' => 1, 'message' => $e->getMessage()];
            $this->statusCode = 500;
        }

        // Output the response
        $this->output();
    }
public function process()
    {
        // Check if we should verify the request
        if ($this->configuration->getUseAuthorization()) {
            if (
                $this->uri != '/token' &&
                $this->uri != '/authorize' &&
                !$this->tokenServer->verifyResourceRequest(\OAuth2\Request::createFromGlobals())
            ) {
                // Get the data as json and convert it to an array,
                // - so we can set our own response type.
                $data = $this->tokenServer->getResponse()->getResponseBody('json');
                $data = json_decode($data, true);

                // Set the response, status code and output content setting final output to true
                $this->response = $data;
                $this->statusCode = $this->tokenServer->getResponse()->getStatusCode();
                $this->output(true);
                return $this;
            }
        }

        try {
            // Handle OPTIONS requests
            if ($this->method == 'options') {
                $this->handleOptionsRequest();
            } else {
                // Execute the router
                $this->router->execute();
            }
        } catch (\Exception $e) {
            // Set the response and status code to error
            $this->response = ['error' => 1, 'message' => $e->getMessage()];
            $this->statusCode = 500;
        }

        // Output the response
        $this->output();
    }
public function process ( ) { // Check if we should verify the request if ( $ this -> configuration -> getUseAuthorization ( ) ) { if ( $ this -> uri != '/token' && $ this -> uri != '/authorize' && ! $ this -> tokenServer -> verifyResourceRequest ( \ OAuth2 \ Request :: createFromGlobals ( ) ) ) { // Get the data as json and convert it to an array, // - so we can set our own response type. $ data = $ this -> tokenServer -> getResponse ( ) -> getResponseBody ( 'json' ) ; $ data = json_decode ( $ data , true ) ; // Set the response, status code and output content setting final output to true $ this -> response = $ data ; $ this -> statusCode = $ this -> tokenServer -> getResponse ( ) -> getStatusCode ( ) ; $ this -> output ( true ) ; return $ this ; } } try { // Handle OPTIONS requests if ( $ this -> method == 'options' ) { $ this -> handleOptionsRequest ( ) ; } else { // Execute the router $ this -> router -> execute ( ) ; } } catch ( \ Exception $ e ) { // Set the response and status code to error $ this -> response = [ 'error' => 1 , 'message' => $ e -> getMessage ( ) ] ; $ this -> statusCode = 500 ; } // Output the response $ this -> output ( ) ; }
Processes the API by calling the execute method on the router.

@return $this The current object.
Processes the API by calling the execute method on the router .