Nonce.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 default_0000-00-00%2000%3A00%3A00
  16. public $modified; // datetime() 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, 'default' => '0000-00-00 00:00:00', 'description' => 'date this record was created'),
  42. 'modified' => array('type' => 'datetime', 'not null' => true, 'default' => 'CURRENT_TIMESTAMP', 'description' => 'date this record was modified'),
  43. ),
  44. 'primary key' => array('consumer_key', 'ts', 'nonce'),
  45. );
  46. }
  47. }