Initializing aHeaderFields to avoid notices
[squirrelmail.git] / class / mime / MessageHeader.class.php
CommitLineData
19d470aa 1<?php
2
3/**
4 * MessageHeader.class.php
5 *
6c84ba1e 6 * Copyright (c) 2003-2005 The SquirrelMail Project Team
19d470aa 7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
0f459286 9 * This file contains functions needed to handle headers in mime messages.
19d470aa 10 *
883d9cd3 11 * @version $Id$
2b646597 12 * @package squirrelmail
0f459286 13 * @subpackage mime
14 * @since 1.3.2
19d470aa 15 */
16
2b646597 17/**
0f459286 18 * Message header class
19 * Class contains all variables available in a bodystructure
20 * entity like described in rfc2060
21 * It was called msg_header in 1.3.0 and 1.3.1.
2b646597 22 * @package squirrelmail
0f459286 23 * @subpackage mime
24 * @since 1.3.2
25 * @todo document vars
2b646597 26 */
19d470aa 27class MessageHeader {
19d470aa 28 var $type0 = '',
29 $type1 = '',
30 $parameters = array(),
31 $id = 0,
32 $description = '',
33 $encoding='',
34 $size = 0,
35 $md5='',
36 $disposition = '',
37 $language='';
38
0f459286 39 /**
40 * Sets header variable
41 * @param string $var
42 * @param mixed $value
19d470aa 43 */
19d470aa 44 function setVar($var, $value) {
45 $this->{$var} = $value;
46 }
47
0f459286 48 /**
49 * Gets parameter value from $parameters array
50 * @param string $p
51 * @return mixed
52 */
19d470aa 53 function getParameter($p) {
54 $value = strtolower($p);
55 return (isset($this->parameters[$p]) ? $this->parameters[$p] : '');
56 }
57
0f459286 58 /**
59 * Sets parameter value in $parameters array
60 * @param string $parameter
61 * @param mixed $value
62 */
19d470aa 63 function setParameter($parameter, $value) {
64 $this->parameters[strtolower($parameter)] = $value;
65 }
66}
67
ce68b76b 68?>