adding index files in order to prevent directory listing.
[squirrelmail.git] / class / mime / ContentType.class.php
CommitLineData
19d470aa 1<?php
2
3/**
4 * ContentType.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 content type headers
10 * (rfc2045) in mime messages.
19d470aa 11 *
883d9cd3 12 * @version $Id$
2b646597 13 * @package squirrelmail
0f459286 14 * @subpackage mime
15 * @since 1.3.2
19d470aa 16 */
17
2b646597 18/**
0f459286 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.
2b646597 22 * @package squirrelmail
0f459286 23 * @subpackage mime
24 * @since 1.3.2
2b646597 25 */
19d470aa 26class ContentType {
0f459286 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 = '';
19d470aa 43
0f459286 44 /**
45 * Constructor function.
46 * Prepared type0 and type1 properties
47 * @param string $type content type string without auxiliary information
48 */
19d470aa 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
8d8da447 61?>