Nonce.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Table Definition for nonce
  4. */
  5. require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
  6. class Nonce extends Managed_DataObject
  7. {
  8. ###START_AUTOCODE
  9. /* the code below is auto generated do not remove the above tag */
  10. public $__table = 'nonce'; // table name
  11. public $consumer_key; // varchar(191) primary_key not_null not 255 because utf8mb4 takes more space
  12. public $tok; // char(32)
  13. public $nonce; // char(32) primary_key not_null
  14. public $ts; // datetime() primary_key not_null
  15. public $created; // datetime() not_null
  16. public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
  17. /* the code above is auto generated do not remove the tag below */
  18. ###END_AUTOCODE
  19. /**
  20. * Compatibility hack for PHP 5.3
  21. *
  22. * The statusnet.links.ini entry cannot be read because "," is no longer
  23. * allowed in key names when read by parse_ini_file().
  24. *
  25. * @return array
  26. * @access public
  27. */
  28. function links()
  29. {
  30. return array('consumer_key,token' => 'token:consumer_key,token');
  31. }
  32. public static function schemaDef()
  33. {
  34. return array(
  35. 'description' => 'OAuth nonce record',
  36. 'fields' => array(
  37. 'consumer_key' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'unique identifier, root URL'),
  38. 'tok' => array('type' => 'char', 'length' => 32, 'description' => 'buggy old value, ignored'),
  39. 'nonce' => array('type' => 'char', 'length' => 32, 'not null' => true, 'description' => 'nonce'),
  40. 'ts' => array('type' => 'datetime', 'not null' => true, 'description' => 'timestamp sent'),
  41. 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
  42. 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
  43. ),
  44. 'primary key' => array('consumer_key', 'ts', 'nonce'),
  45. );
  46. }
  47. }