MessageHeader.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. */
  21. /**
  22. * Message Headers provide context for the processing of the
  23. * the AMF Packet and all subsequent Messages.
  24. *
  25. * Multiple Message Headers may be included within an AMF Packet.
  26. *
  27. * @package Zend_Amf
  28. * @subpackage Value
  29. * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
  30. * @license http://framework.zend.com/license/new-bsd New BSD License
  31. */
  32. class Zend_Amf_Value_MessageHeader
  33. {
  34. /**
  35. * Name of the header
  36. *
  37. * @var string
  38. */
  39. public $name;
  40. /**
  41. * Flag if the data has to be parsed on return
  42. *
  43. * @var boolean
  44. */
  45. public $mustRead;
  46. /**
  47. * Length of the data field
  48. *
  49. * @var int
  50. */
  51. public $length;
  52. /**
  53. * Data sent with the header name
  54. *
  55. * @var mixed
  56. */
  57. public $data;
  58. /**
  59. * Used to create and store AMF Header data.
  60. *
  61. * @param String $name
  62. * @param Boolean $mustRead
  63. * @param misc $content
  64. * @param integer $length
  65. */
  66. public function __construct($name, $mustRead, $data, $length=null)
  67. {
  68. $this->name = $name;
  69. $this->mustRead = (bool) $mustRead;
  70. $this->data = $data;
  71. if (null !== $length) {
  72. $this->length = (int) $length;
  73. }
  74. }
  75. }