PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://bitbucket.org/chamilo/chamilo/
PHP | 78 lines | 18 code | 8 blank | 52 comment | 0 complexity | 753f290641372d69b1275e4899e947e7 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 Consumer representation
  20. *
  21. * @package OAuth
  22. */
  23. class OAuth_Consumer {
  24. /**
  25. * Consumer Key string
  26. *
  27. * @var string
  28. */
  29. public $key;
  30. /**
  31. * Consumer Secret string
  32. *
  33. * @var string
  34. */
  35. public $secret;
  36. /**
  37. * Constructor
  38. *
  39. * @param string $key oauth_consumer_key
  40. * @param string $secret oauth_consumer_secret
  41. */
  42. public function __construct($key, $secret) {
  43. $this->key = $key;
  44. $this->secret = $secret;
  45. }
  46. /**
  47. * Magic function that shows who we are
  48. *
  49. * @return string key of consumer oauth_consumer_key
  50. */
  51. public function __toString() {
  52. return urlencode($this->getKey());
  53. }
  54. /**
  55. * Get the key
  56. *
  57. * @return string key of consumer oauth_consumer_key
  58. */
  59. public function getKey() {
  60. return $this->key;
  61. }
  62. /**
  63. * get the secret
  64. *
  65. * @return string secret of consumer oauth_consumer_secret
  66. */
  67. public function getSecret() {
  68. return $this->secret;
  69. }
  70. }