You are here

public function OAuthStoreAbstract::generateKey in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/store/OAuthStoreAbstract.class.php \OAuthStoreAbstract::generateKey()
  2. 7.2 lib/oauth-php/library/store/OAuthStoreAbstract.class.php \OAuthStoreAbstract::generateKey()
  3. 7.3 lib/oauth-php/library/store/OAuthStoreAbstract.class.php \OAuthStoreAbstract::generateKey()
  4. 7.4 lib/oauth-php/library/store/OAuthStoreAbstract.class.php \OAuthStoreAbstract::generateKey()
  5. 7.5 lib/oauth-php/library/store/OAuthStoreAbstract.class.php \OAuthStoreAbstract::generateKey()

* Generate a unique key * *

Parameters

boolean unique force the key to be unique: * @return string

12 calls to OAuthStoreAbstract::generateKey()
OAuthStoreOracle::addConsumerRequestToken in lib/oauth-php/library/store/OAuthStoreOracle.php
* Add an unautorized request token to our server. * *
OAuthStoreOracle::exchangeConsumerRequestForAccessToken in lib/oauth-php/library/store/OAuthStoreOracle.php
* Exchange an authorized request token for new access token. * *
OAuthStoreOracle::getConsumerStatic in lib/oauth-php/library/store/OAuthStoreOracle.php
* Fetch the static consumer key for this provider. The user for the static consumer * key is NULL (no user, shared key). If the key did not exist then the key is created. * *
OAuthStoreOracle::updateConsumer in lib/oauth-php/library/store/OAuthStoreOracle.php
* Insert/update a new consumer with this server (we will be the server) * When this is a new consumer, then also generate the consumer key and secret. * Never updates the consumer key and secret. * When the id is set, then the key and secret…
OAuthStorePostgreSQL::addConsumerRequestToken in lib/oauth-php/library/store/OAuthStorePostgreSQL.php
Add an unautorized request token to our server.

... See full list

File

lib/oauth-php/library/store/OAuthStoreAbstract.class.php, line 91

Class

OAuthStoreAbstract
Abstract base class for OAuthStore implementations

Code

public function generateKey($unique = false) {
  $key = md5(uniqid(rand(), true));
  if ($unique) {
    list($usec, $sec) = explode(' ', microtime());
    $key .= dechex($usec) . dechex($sec);
  }
  return $key;
}