PageRenderTime 54ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/common/libraries/plugin/pear/OAuth/Token.php

https://bitbucket.org/chamilo/chamilo/
PHP | 79 lines | 19 code | 8 blank | 52 comment | 0 complexity | cfc2fbedf0283016240261cccec80440 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause, LGPL-2.1, LGPL-3.0, GPL-3.0, MIT
  1. <?php
  2. /**
  3. * OAuth Model objects
  4. *
  5. * Adapted from Andy Smith's OAuth library for PHP
  6. *
  7. * @link http://oauth.net/core/1.0
  8. * @link http://oauth.googlecode.com/svn/spec/ext/consumer_request/1.0/drafts/1/spec.html
  9. * @link http://oauth.googlecode.com/svn/code/php/
  10. * @link http://term.ie/oauth/example/
  11. *
  12. * @package OAuth
  13. *
  14. * @author jhart
  15. * @copyright Copyright (c) 2008, Photobucket, Inc.
  16. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  17. */
  18. /**
  19. * OAuth Token representation
  20. *
  21. * @package OAuth
  22. */
  23. class OAuth_Token {
  24. /**
  25. * Token key
  26. *
  27. * @var string oauth_token
  28. */
  29. public $key;
  30. /**
  31. * Token secret
  32. *
  33. * @var string oauth_token_secret
  34. */
  35. public $secret;
  36. /**
  37. * Constructor
  38. *
  39. * @param string $key oauth_token
  40. * @param string $secret oauth_token_secret
  41. */
  42. public function __construct($key, $secret) {
  43. $this->key = $key;
  44. $this->secret = $secret;
  45. }
  46. /**
  47. * Returns postdata representation of the token
  48. *
  49. * @return string postdata and OAuth Standard representation
  50. */
  51. public function __toString() {
  52. return 'oauth_token=' . urlencode($this->getKey())
  53. . '&oauth_token_secret=' . urlencode($this->getSecret());
  54. }
  55. /**
  56. * get key
  57. *
  58. * @return string oauth_token
  59. */
  60. public function getKey() {
  61. return $this->key;
  62. }
  63. /**
  64. * get token
  65. *
  66. * @return string oauth_token_secret
  67. */
  68. public function getSecret() {
  69. return $this->secret;
  70. }
  71. }