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.  */
  26.  
  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. {
  37.     /**
  38.      * The disposition type, either "inline" or "attachment".
  39.      *
  40.      * @var string 
  41.      */
  42.     public $disposition;
  43.  
  44.     /**
  45.      * The filename of the attachment.
  46.      *
  47.      * The filename should never include path information.
  48.      *
  49.      * @var string 
  50.      */
  51.     public $fileName;
  52.  
  53.     /**
  54.      * The filename of the attachment, formatted for display. Used only for
  55.      * parsing, not used when generating a mail.
  56.      *
  57.      * The filename should never include path information.
  58.      *
  59.      * Added for issue #13038. If you use __set_state() be sure to set this
  60.      * property also.
  61.      *
  62.      * @var string 
  63.      */
  64.     public $displayFileName;
  65.  
  66.     /**
  67.      * The language of the filename.
  68.      *
  69.      * @var string 
  70.      */
  71.     public $fileNameLanguage;
  72.  
  73.     /**
  74.      * The characterset of the file name.
  75.      *
  76.      * @var string 
  77.      */
  78.     public $fileNameCharSet;
  79.  
  80.     /**
  81.      * The creation date of the file attachment.
  82.      *
  83.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
  84.      * section 5.
  85.      *
  86.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
  87.      *
  88.      * @var string 
  89.      */
  90.     public $creationDate;
  91.  
  92.     /**
  93.      * The last modification date of the file attachment.
  94.      *
  95.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
  96.      * section 5.
  97.      *
  98.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
  99.      *
  100.      * @var string 
  101.      */
  102.     public $modificationDate;
  103.  
  104.     /**
  105.      * The last date the file attachment was read.
  106.      *
  107.      * The time should be formatted as specified by http://www.faqs.org/rfcs/rfc822.html
  108.      * section 5.
  109.      *
  110.      * A typical example is: Sun, 21 May 2006 16:00:50 +0400
  111.      *
  112.      * @var string 
  113.      */
  114.     public $readDate;
  115.  
  116.     /**
  117.      * The size of the content in bytes.
  118.      *
  119.      * @var int 
  120.      */
  121.     public $size;
  122.  
  123.     /**
  124.      * Any additional parameters provided in the Content-Disposition header.
  125.      *
  126.      * The format of the field is array(parameterName=>parameterValue)
  127.      *
  128.      * @var array(string=>string) 
  129.      */
  130.     public $additionalParameters = array();
  131.  
  132.     /**
  133.      * Holds language and characterset data for the additional parameters.
  134.      *
  135.      * Format: array(parameterName=>array('charSet'=>string,'language'=>string))
  136.      *
  137.      * @apichange Merge this with $additionalParamters OR come up with an entirely new idea for the ContentDispositionHeader
  138.      * @var array(string=>array()) 
  139.      */
  140.     public $additionalParametersMetaData = array();
  141.  
  142.     /**
  143.      * Constructs a new ezcMailContentDispositionHeader holding the various values of this
  144.      * container.
  145.      *
  146.      * @param string $disposition 
  147.      * @param string $fileName 
  148.      * @param string $creationDate 
  149.      * @param string $modificationDate 
  150.      * @param string $readDate 
  151.      * @param string $size 
  152.      * @param array(string=>string) $additionalParameters 
  153.      * @param string $fileNameLanguage 
  154.      * @param string $fileNameCharSet 
  155.      */
  156.     public function __construct$disposition 'inline',
  157.                                  $fileName null,
  158.                                  $creationDate null,
  159.                                  $modificationDate null,
  160.                                  $readDate null,
  161.                                  $size null,
  162.                                  $additionalParameters array(),
  163.                                  $fileNameLanguage null,
  164.                                  $fileNameCharSet null,
  165.                                  $displayFileName null )
  166.     {
  167.         $this->disposition = $disposition;
  168.         $this->fileName = $fileName;
  169.         $this->fileNameLanguage = $fileNameLanguage;
  170.         $this->fileNameCharSet = $fileNameCharSet;
  171.         $this->displayFileName = $displayFileName;
  172.         $this->creationDate = $creationDate;
  173.         $this->modificationDate = $modificationDate;
  174.         $this->readDate = $readDate;
  175.         $this->size = $size;
  176.         $this->additionalParameters = $additionalParameters;
  177.     }
  178.  
  179.     /**
  180.      * Returns a new instance of this class with the data specified by $array.
  181.      *
  182.      * $array contains all the data members of this class in the form:
  183.      * array('member_name'=>value).
  184.      *
  185.      * __set_state makes this class exportable with var_export.
  186.      * var_export() generates code, that calls this method when it
  187.      * is parsed with PHP.
  188.      *
  189.      * @param array(string=>mixed) $array 
  190.      * @return ezcMailAddress 
  191.      */
  192.     static public function __set_statearray $array )
  193.     {
  194.         return new ezcMailContentDispositionHeader$array['disposition'],
  195.                                                     $array['fileName'],
  196.                                                     $array['creationDate'],
  197.                                                     $array['modificationDate'],
  198.                                                     $array['readDate'],
  199.                                                     $array['size'],
  200.                                                     $array['additionalParameters'],
  201.                                                     $array['fileNameLanguage'],
  202.                                                     $array['fileNameCharSet'],
  203.                                                     $array['displayFileName']
  204.                                                     );
  205.     }
  206. }
  207.  
  208. ?>
Documentation generated by phpDocumentor 1.4.3