MessageHeader.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * Zend Framework
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://framework.zend.com/license/new-bsd
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@zend.com so we can send you a copy immediately.
  14. *
  15. * @category Zend
  16. * @package Zend_Amf
  17. * @subpackage Value
  18. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  19. * @license http://framework.zend.com/license/new-bsd New BSD License
  20. * @version $Id: MessageHeader.php 2504 2011-12-28 07:35:29Z liu21st $
  21. */
  22. /**
  23. * Message Headers provide context for the processing of the
  24. * the AMF Packet and all subsequent Messages.
  25. *
  26. * Multiple Message Headers may be included within an AMF Packet.
  27. *
  28. * @package Zend_Amf
  29. * @subpackage Value
  30. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  31. * @license http://framework.zend.com/license/new-bsd New BSD License
  32. */
  33. class Zend_Amf_Value_MessageHeader
  34. {
  35. /**
  36. * Name of the header
  37. *
  38. * @var string
  39. */
  40. public $name;
  41. /**
  42. * Flag if the data has to be parsed on return
  43. *
  44. * @var boolean
  45. */
  46. public $mustRead;
  47. /**
  48. * Length of the data field
  49. *
  50. * @var int
  51. */
  52. public $length;
  53. /**
  54. * Data sent with the header name
  55. *
  56. * @var mixed
  57. */
  58. public $data;
  59. /**
  60. * Used to create and store AMF Header data.
  61. *
  62. * @param String $name
  63. * @param Boolean $mustRead
  64. * @param misc $content
  65. * @param integer $length
  66. */
  67. public function __construct($name, $mustRead, $data, $length=null)
  68. {
  69. $this->name = $name;
  70. $this->mustRead = (bool) $mustRead;
  71. $this->data = $data;
  72. if (null !== $length) {
  73. $this->length = (int) $length;
  74. }
  75. }
  76. }