You are here

class OAuthSession in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/OAuthSession.php \OAuthSession
  2. 7.2 lib/oauth-php/library/OAuthSession.php \OAuthSession
  3. 7.3 lib/oauth-php/library/OAuthSession.php \OAuthSession
  4. 7.4 lib/oauth-php/library/OAuthSession.php \OAuthSession
  5. 7.5 lib/oauth-php/library/OAuthSession.php \OAuthSession

Hierarchy

Expanded class hierarchy of OAuthSession

1 string reference to 'OAuthSession'
OAuthSession::instance in lib/oauth-php/library/OAuthSession.php
* Request an instance of the OAuthSession

File

lib/oauth-php/library/OAuthSession.php, line 37

View source
class OAuthSession {
  private static $instance = false;

  /**
   * Request an instance of the OAuthSession
   */
  public static function instance($store = 'SESSION', $options = array()) {
    if (!OAuthSession::$instance) {

      // Select the store you want to use
      if (strpos($store, '/') === false) {
        $class = 'OAuthSession' . $store;
        $file = dirname(__FILE__) . '/session/' . $class . '.php';
      }
      else {
        $file = $store;
        $store = basename($file, '.php');
        $class = $store;
      }
      if (is_file($file)) {
        require_once $file;
        if (class_exists($class)) {
          OAuthSession::$instance = new $class($options);
        }
        else {
          throw new OAuthException2('Could not find class ' . $class . ' in file ' . $file);
        }
      }
      else {
        throw new OAuthException2('No OAuthSession for ' . $store . ' (file ' . $file . ')');
      }
    }
    return OAuthSession::$instance;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OAuthSession::$instance private static property
OAuthSession::instance public static function * Request an instance of the OAuthSession