php 5.1b2 - can't use function call inside array_shift() function.
[squirrelmail.git] / class / mime / ContentType.class.php
1 <?php
2
3 /**
4 * ContentType.class.php
5 *
6 * Copyright (c) 2003-2005 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * This file contains functions needed to handle content type headers
10 * (rfc2045) in mime messages.
11 *
12 * @version $Id$
13 * @package squirrelmail
14 * @subpackage mime
15 * @since 1.3.2
16 */
17
18 /**
19 * Class that handles content-type headers
20 * Class was named content_type in 1.3.0 and 1.3.1. It is used internally
21 * by rfc822header class.
22 * @package squirrelmail
23 * @subpackage mime
24 * @since 1.3.2
25 */
26 class ContentType {
27 /**
28 * Media type
29 * @var string
30 */
31 var $type0 = 'text';
32 /**
33 * Media subtype
34 * @var string
35 */
36 var $type1 = 'plain';
37 /**
38 * Auxiliary header information
39 * prepared with parseContentType() function in rfc822header class.
40 * @var array
41 */
42 var $properties = '';
43
44 /**
45 * Constructor function.
46 * Prepared type0 and type1 properties
47 * @param string $type content type string without auxiliary information
48 */
49 function ContentType($type) {
50 $pos = strpos($type, '/');
51 if ($pos > 0) {
52 $this->type0 = substr($type, 0, $pos);
53 $this->type1 = substr($type, $pos+1);
54 } else {
55 $this->type0 = $type;
56 }
57 $this->properties = array();
58 }
59 }
60
61 ?>