You are here

static function OAuthRequestLogger::start in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/OAuthRequestLogger.php \OAuthRequestLogger::start()

* Start any logging, checks the system configuration if logging is needed. * *

Parameters

OAuthRequest $request_object:

8 calls to OAuthRequestLogger::start()
OAuthRequester::requestAccessToken in lib/oauth-php/library/OAuthRequester.php
* Request an access token from the site belonging to consumer_key. * Before this we got an request token, now we want to exchange it for * an access token. * *
OAuthRequester::requestRequestToken in lib/oauth-php/library/OAuthRequester.php
* Request a request token from the site belonging to consumer_key * *
OAuthRequestVerifier::verifyIfSigned in lib/oauth-php/library/OAuthRequestVerifier.php
* Verify the request if it seemed to be signed. * *
OAuthRequestVerifier::__construct in lib/oauth-php/library/OAuthRequestVerifier.php
* Construct the request to be verified * *
OAuthServer::accessToken in lib/oauth-php/library/OAuthServer.php
* Exchange a request token for an access token. * The exchange is only succesful iff the request token has been authorized. * * Never returns, calls exit() when token is exchanged or when error is returned.

... See full list

File

lib/oauth-php/library/OAuthRequestLogger.php, line 51

Class

OAuthRequestLogger
Log OAuth requests

Code

static function start($request_object = null) {
  if (defined('OAUTH_LOG_REQUEST')) {
    if (is_null(OAuthRequestLogger::$enable_logging)) {
      OAuthRequestLogger::$enable_logging = true;
    }
    if (is_null(OAuthRequestLogger::$store_log)) {
      OAuthRequestLogger::$store_log = true;
    }
  }
  if (OAuthRequestLogger::$enable_logging && !OAuthRequestLogger::$logging) {
    OAuthRequestLogger::$logging = true;
    OAuthRequestLogger::$request_object = $request_object;
    ob_start();

    // Make sure we flush our log entry when we stop the request (eg on an exception)
    register_shutdown_function(array(
      'OAuthRequestLogger',
      'flush',
    ));
  }
}