3 * A Trivial memory-based store - no support for tokens
5 class TrivialOAuthDataStore extends OAuthDataStore {
6 private $consumers = array();
8 function add_consumer($consumer_key, $consumer_secret) {
9 $this->consumers[$consumer_key] = $consumer_secret;
12 function lookup_consumer($consumer_key) {
13 if ( strpos($consumer_key, "http://" ) === 0 ) {
14 $consumer = new OAuthConsumer($consumer_key,"secret", NULL);
17 if ( $this->consumers[$consumer_key] ) {
18 $consumer = new OAuthConsumer($consumer_key,$this->consumers[$consumer_key], NULL);
24 function lookup_token($consumer, $token_type, $token) {
25 return new OAuthToken($consumer, "");
28 // Return NULL if the nonce has not been used
29 // Return $nonce if the nonce was previously used
30 function lookup_nonce($consumer, $token, $nonce, $timestamp) {
31 // Should add some clever logic to keep nonces from
32 // being reused - for no we are really trusting
33 // that the timestamp will save us
37 function new_request_token($consumer) {
41 function new_access_token($token, $consumer) {