increment year in copyright notices
[squirrelmail.git] / class / mime / ContentType.class.php
CommitLineData
19d470aa 1<?php
2
3/**
4 * ContentType.class.php
5 *
0f459286 6 * This file contains functions needed to handle content type headers
7 * (rfc2045) in mime messages.
19d470aa 8 *
4b5049de 9 * @copyright &copy; 2003-2007 The SquirrelMail Project Team
4b4abf93 10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
883d9cd3 11 * @version $Id$
2b646597 12 * @package squirrelmail
0f459286 13 * @subpackage mime
14 * @since 1.3.2
19d470aa 15 */
16
2b646597 17/**
0f459286 18 * Class that handles content-type headers
19 * Class was named content_type in 1.3.0 and 1.3.1. It is used internally
20 * by rfc822header class.
2b646597 21 * @package squirrelmail
0f459286 22 * @subpackage mime
23 * @since 1.3.2
2b646597 24 */
19d470aa 25class ContentType {
0f459286 26 /**
27 * Media type
28 * @var string
29 */
30 var $type0 = 'text';
31 /**
32 * Media subtype
33 * @var string
34 */
35 var $type1 = 'plain';
36 /**
37 * Auxiliary header information
38 * prepared with parseContentType() function in rfc822header class.
39 * @var array
40 */
41 var $properties = '';
19d470aa 42
0f459286 43 /**
44 * Constructor function.
45 * Prepared type0 and type1 properties
46 * @param string $type content type string without auxiliary information
47 */
19d470aa 48 function ContentType($type) {
49 $pos = strpos($type, '/');
50 if ($pos > 0) {
51 $this->type0 = substr($type, 0, $pos);
52 $this->type1 = substr($type, $pos+1);
53 } else {
54 $this->type0 = $type;
55 }
56 $this->properties = array();
57 }
58}