increment year in copyright notices
[squirrelmail.git] / class / mime / MessageHeader.class.php
CommitLineData
19d470aa 1<?php
2
3/**
4 * MessageHeader.class.php
5 *
0f459286 6 * This file contains functions needed to handle headers in mime messages.
19d470aa 7 *
4b5049de 8 * @copyright &copy; 2003-2007 The SquirrelMail Project Team
4b4abf93 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
883d9cd3 10 * @version $Id$
2b646597 11 * @package squirrelmail
0f459286 12 * @subpackage mime
13 * @since 1.3.2
19d470aa 14 */
15
2b646597 16/**
0f459286 17 * Message header class
18 * Class contains all variables available in a bodystructure
19 * entity like described in rfc2060
20 * It was called msg_header in 1.3.0 and 1.3.1.
2b646597 21 * @package squirrelmail
0f459286 22 * @subpackage mime
23 * @since 1.3.2
2b646597 24 */
19d470aa 25class MessageHeader {
9ed80157 26 /**
27 * Media type
28 * @var string
29 */
30 var $type0 = '';
31 /**
32 * Media subtype
33 * @var string
34 */
35 var $type1 = '';
36 /**
37 * Content type parameters
38 * @var array
39 */
40 var $parameters = array();
41 /**
42 * @var mixed
43 */
44 var $id = 0;
45 /**
46 * @var string
47 */
48 var $description = '';
49 /**
50 * @var string
51 */
52 var $encoding='';
53 /**
54 * Message size
55 * @var integer
56 */
57 var $size = 0;
58 /**
59 * @var string
60 */
61 var $md5='';
62 /**
63 * @var mixed
64 */
65 var $disposition = '';
66 /**
67 * @var mixed
68 */
69 var $language='';
19d470aa 70
0f459286 71 /**
72 * Sets header variable
73 * @param string $var
74 * @param mixed $value
19d470aa 75 */
19d470aa 76 function setVar($var, $value) {
77 $this->{$var} = $value;
78 }
79
0f459286 80 /**
81 * Gets parameter value from $parameters array
82 * @param string $p
83 * @return mixed
84 */
19d470aa 85 function getParameter($p) {
86 $value = strtolower($p);
87 return (isset($this->parameters[$p]) ? $this->parameters[$p] : '');
88 }
89
0f459286 90 /**
91 * Sets parameter value in $parameters array
92 * @param string $parameter
93 * @param mixed $value
94 */
19d470aa 95 function setParameter($parameter, $value) {
96 $this->parameters[strtolower($parameter)] = $value;
97 }
98}