## Apache Zeta Components Manual :: File Source for content_disposition_header.php

## Source for file content_disposition_header.php

Documentation is available at content_disposition_header.php

1. <?php
2. /**
3. *
4. * Licensed to the Apache Software Foundation (ASF) under one
5. * or more contributor license agreements. See the NOTICE file
6. * distributed with this work for additional information
7. * regarding copyright ownership. The ASF licenses this file
8. * to you under the Apache License, Version 2.0 (the
9. * "License"); you may not use this file except in compliance
10. * with the License. You may obtain a copy of the License at
11. *
12. * http://www.apache.org/licenses/LICENSE-2.0
13. *
14. * Unless required by applicable law or agreed to in writing,
15. * software distributed under the License is distributed on an
16. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17. * KIND, either express or implied. See the License for the
18. * specific language governing permissions and limitations
19. * under the License.
20. *
21. * @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
22. * @version //autogentag//
23. * @filesource
24. * @package Mail
25. */
27. /**
28. * A container to store a Content-Disposition header as described in http://www.faqs.org/rfcs/rfc2183.
29. *
30. * This container is used on the contentDisposition property on mail parts.
31. * Use it for reading and setting the Content-Disposition header.
32. *
33. * @package Mail
34. * @version //autogentag//
35. */
36. class ezcMailContentDispositionHeader extends ezcBaseStruct
37. {
38. /**
39. * The disposition type, either "inline" or "attachment".
40. *
41. * @var string
42. */
43. public $disposition ;
45. /**
46. * The filename of the attachment.
47. *
48. * The filename should never include path information.
49. *
50. * @var string
51. */
52. public $fileName ;
54. /**
55. * The filename of the attachment, formatted for display. Used only for
56. * parsing, not used when generating a mail.
57. *
58. * The filename should never include path information.
59. *
60. * Added for issue #13038. If you use __set_state() be sure to set this
61. * property also.
62. *
63. * @var string
64. */
65. public $displayFileName ;
67. /**
68. * The language of the filename.
69. *
70. * @var string
71. */
72. public $fileNameLanguage ;
74. /**
75. * The characterset of the file name.
76. *
77. * @var string
78. */
79. public $fileNameCharSet ;
81. /**
82. * The creation date of the file attachment.
83. *
84. * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
85. * section 5.
86. *
87. * A typical example is: Sun, 21 May 2006 16:00:50 +0400
88. *
89. * @var string
90. */
91. public $creationDate ;
93. /**
94. * The last modification date of the file attachment.
95. *
96. * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
97. * section 5.
98. *
99. * A typical example is: Sun, 21 May 2006 16:00:50 +0400
100. *
101. * @var string
102. */
103. public $modificationDate ;
105. /**
106. * The last date the file attachment was read.
107. *
108. * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
109. * section 5.
110. *
111. * A typical example is: Sun, 21 May 2006 16:00:50 +0400
112. *
113. * @var string
114. */
115. public $readDate ;
117. /**
118. * The size of the content in bytes.
119. *
120. * @var int
121. */
122. public $size ;
124. /**
125. * Any additional parameters provided in the Content-Disposition header.
126. *
127. * The format of the field is array(parameterName=>parameterValue)
128. *
129. * @var array(string=>string)
130. */
131. public $additionalParameters = array();
133. /**
134. * Holds language and characterset data for the additional parameters.
135. *
136. * Format: array(parameterName=>array('charSet'=>string,'language'=>string))
137. *
138. * @apichange Merge this with $additionalParamters OR come up with an entirely new idea for the ContentDispositionHeader
139. * @var array(string=>array())
140. */
141. public $additionalParametersMetaData = array();
143. /**
144. * Constructs a new ezcMailContentDispositionHeader holding the various values of this
145. * container.
146. *
147. * @param string $disposition
148. * @param string $fileName
149. * @param string $creationDate
150. * @param string $modificationDate
151. * @param string $readDate
152. * @param string $size
153. * @param array(string=>string) $additionalParameters
154. * @param string $fileNameLanguage
155. * @param string $fileNameCharSet
156. */
157. public function __construct ( $disposition = 'inline',
158. $fileName = null,
159. $creationDate = null,
160. $modificationDate = null,
161. $readDate = null,
162. $size = null,
163. $additionalParameters = array(),
164. $fileNameLanguage = null,
165. $fileNameCharSet = null,
166. $displayFileName = null )
167. {
168. $this-> disposition = $disposition;
169. $this-> fileName = $fileName;
170. $this-> fileNameLanguage = $fileNameLanguage;
171. $this-> fileNameCharSet = $fileNameCharSet;
172. $this-> displayFileName = $displayFileName;
173. $this-> creationDate = $creationDate;
174. $this-> modificationDate = $modificationDate;
175. $this-> readDate = $readDate;
176. $this-> size = $size;
177. $this-> additionalParameters = $additionalParameters;
178. }
180. /**
181. * Returns a new instance of this class with the data specified by $array.
182. *
183. * $array contains all the data members of this class in the form:
184. * array('member_name'=>value).
185. *
186. * __set_state makes this class exportable with var_export.
187. * var_export() generates code, that calls this method when it
188. * is parsed with PHP.
189. *
190. * @param array(string=>mixed) $array
191. * @return ezcMailAddress
192. */
193. static public function __set_state ( array $array )
194. {
195. return new ezcMailContentDispositionHeader( $array['disposition'],
196. $array['fileName'],
197. $array['creationDate'],
198. $array['modificationDate'],
199. $array['readDate'],
200. $array['size'],
201. $array['additionalParameters'],
202. $array['fileNameLanguage'],
203. $array['fileNameCharSet'],
204. $array['displayFileName']
205. );
206. }
207. }
209. ?>

Documentation generated by phpDocumentor 1.4.3