Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: OpenID

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5
Source code for file /openid/Auth/OpenID/SQLiteStore.php

Documentation is available at SQLiteStore.php

  1. <?php
  2.  
  3. /**
  4.  * An SQLite store.
  5.  *
  6.  * @package OpenID
  7.  */
  8.  
  9. /**
  10.  * Require the base class file.
  11.  */
  12. require_once "Auth/OpenID/SQLStore.php";
  13.  
  14. /**
  15.  * An SQL store that uses SQLite as its backend.
  16.  *
  17.  * @package OpenID
  18.  */
  19.     function setSQL()
  20.     {
  21.         $this->sql['nonce_table'=
  22.             "CREATE TABLE %s (nonce CHAR(8) UNIQUE PRIMARY KEY, ".
  23.             "expires INTEGER)";
  24.  
  25.         $this->sql['assoc_table'=
  26.             "CREATE TABLE %s (server_url VARCHAR(2047), handle VARCHAR(255), ".
  27.             "secret BLOB(128), issued INTEGER, lifetime INTEGER, ".
  28.             "assoc_type VARCHAR(64), PRIMARY KEY (server_url, handle))";
  29.  
  30.         $this->sql['settings_table'=
  31.             "CREATE TABLE %s (setting VARCHAR(128) UNIQUE PRIMARY KEY, ".
  32.             "value BLOB(20))";
  33.  
  34.         $this->sql['create_auth'=
  35.             "INSERT INTO %s VALUES ('auth_key', ?)";
  36.  
  37.         $this->sql['get_auth'=
  38.             "SELECT value FROM %s WHERE setting = 'auth_key'";
  39.  
  40.         $this->sql['set_assoc'=
  41.             "INSERT OR REPLACE INTO %s VALUES (?, ?, ?, ?, ?, ?)";
  42.  
  43.         $this->sql['get_assocs'=
  44.             "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
  45.             "WHERE server_url = ?";
  46.  
  47.         $this->sql['get_assoc'=
  48.             "SELECT handle, secret, issued, lifetime, assoc_type FROM %s ".
  49.             "WHERE server_url = ? AND handle = ?";
  50.  
  51.         $this->sql['remove_assoc'=
  52.             "DELETE FROM %s WHERE server_url = ? AND handle = ?";
  53.  
  54.         $this->sql['add_nonce'=
  55.             "INSERT OR REPLACE INTO %s (nonce, expires) VALUES (?, ?)";
  56.  
  57.         $this->sql['get_nonce'=
  58.             "SELECT * FROM %s WHERE nonce = ?";
  59.  
  60.         $this->sql['remove_nonce'=
  61.             "DELETE FROM %s WHERE nonce = ?";
  62.     }
  63. }
  64.  
  65. ?>

Documentation generated on Mon, 05 Mar 2007 21:26:36 +0000 by phpDocumentor 1.3.1