當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Zend_Validate_File_MimeType::__construct方法代碼示例

本文整理匯總了PHP中Zend_Validate_File_MimeType::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Validate_File_MimeType::__construct方法的具體用法?PHP Zend_Validate_File_MimeType::__construct怎麽用?PHP Zend_Validate_File_MimeType::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Zend_Validate_File_MimeType的用法示例。


在下文中一共展示了Zend_Validate_File_MimeType::__construct方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Sets validator options
  *
  * @param  string|array|Zend_Config $mimetype
  * @return void
  */
 public function __construct($mimetype = array())
 {
     if ($mimetype instanceof Zend_Config) {
         $mimetype = $mimetype->toArray();
     }
     $temp = array();
     // http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
     // http://www.iana.org/assignments/media-types/image/
     $default = array('application/cdf', 'application/dicom', 'application/fractals', 'application/postscript', 'application/vnd.hp-hpgl', 'application/vnd.oasis.opendocument.graphics', 'application/x-cdf', 'application/x-cmu-raster', 'application/x-ima', 'application/x-inventor', 'application/x-koan', 'application/x-portable-anymap', 'application/x-world-x-3dmf', 'image/bmp', 'image/c', 'image/cgm', 'image/fif', 'image/gif', 'image/jpeg', 'image/jpm', 'image/jpx', 'image/jp2', 'image/naplps', 'image/pjpeg', 'image/png', 'image/svg', 'image/svg+xml', 'image/tiff', 'image/vnd.adobe.photoshop', 'image/vnd.djvu', 'image/vnd.fpx', 'image/vnd.net-fpx', 'image/x-cmu-raster', 'image/x-cmx', 'image/x-coreldraw', 'image/x-cpi', 'image/x-emf', 'image/x-ico', 'image/x-icon', 'image/x-jg', 'image/x-ms-bmp', 'image/x-niff', 'image/x-pict', 'image/x-pcx', 'image/x-portable-anymap', 'image/x-portable-bitmap', 'image/x-portable-greymap', 'image/x-portable-pixmap', 'image/x-quicktime', 'image/x-rgb', 'image/x-tiff', 'image/x-unknown', 'image/x-windows-bmp', 'image/x-xpmi');
     if (is_array($mimetype)) {
         $temp = $mimetype;
         if (array_key_exists('magicfile', $temp)) {
             unset($temp['magicfile']);
         }
         if (array_key_exists('headerCheck', $temp)) {
             unset($temp['headerCheck']);
         }
         if (empty($temp)) {
             $mimetype += $default;
         }
     }
     if (empty($mimetype)) {
         $mimetype = $default;
     }
     parent::__construct($mimetype);
 }
開發者ID:7thZoneTechnology,項目名稱:hrms-1,代碼行數:32,代碼來源:IsImage.php

示例2: __construct

 /**
  * Sets validator options
  *
  * @param  string|array|Zend_Config $compression
  * @return void
  */
 public function __construct($mimetype = array())
 {
     if ($mimetype instanceof Zend_Config) {
         $mimetype = $mimetype->toArray();
     }
     $temp = array();
     // http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
     $default = array('application/arj', 'application/gnutar', 'application/lha', 'application/lzx', 'application/vnd.ms-cab-compressed', 'application/x-ace-compressed', 'application/x-arc', 'application/x-archive', 'application/x-arj', 'application/x-bzip', 'application/x-bzip2', 'application/x-cab-compressed', 'application/x-compress', 'application/x-compressed', 'application/x-cpio', 'application/x-debian-package', 'application/x-eet', 'application/x-gzip', 'application/x-java-pack200', 'application/x-lha', 'application/x-lharc', 'application/x-lzh', 'application/x-lzma', 'application/x-lzx', 'application/x-rar', 'application/x-sit', 'application/x-stuffit', 'application/x-tar', 'application/zip', 'application/zoo', 'multipart/x-gzip');
     if (is_array($mimetype)) {
         $temp = $mimetype;
         if (array_key_exists('magicfile', $temp)) {
             unset($temp['magicfile']);
         }
         if (array_key_exists('headerCheck', $temp)) {
             unset($temp['headerCheck']);
         }
         if (empty($temp)) {
             $mimetype += $default;
         }
     }
     if (empty($mimetype)) {
         $mimetype = $default;
     }
     parent::__construct($mimetype);
 }
開發者ID:schlypel,項目名稱:YiiBackboneBoilerplate,代碼行數:31,代碼來源:IsCompressed.php

示例3: __construct

 /**
  * Sets validator options
  *
  * Mimetype to accept
  *
  * @param  string|array $mimetype MimeType
  * @param string real dir
  * @return void
  */
 public function __construct($mimetype, $dir = null)
 {
     parent::__construct($mimetype);
     if (isset($dir)) {
         $this->_dir = $dir;
     }
 }
開發者ID:bokultis,項目名稱:kardiomedika,代碼行數:16,代碼來源:MimeType.php

示例4: __construct

 /**
  * Sets validator options
  *
  * Mimetype to accept
  *
  * @param  string|array $mimetype MimeType
  * @param string real dir
  * @return void
  */
 public function __construct($options)
 {
     if (isset($options['form_id']) && $options['form_id'] != '') {
         $this->_formId = $options['form_id'];
     }
     if (isset($options['field_id']) && $options['field_id'] != '') {
         $this->_fieldId = $options['field_id'];
     }
     $mimetype = array();
     parent::__construct($mimetype);
     if (Zend_Registry::isRegistered('genericFileHelper')) {
         $fileHelper = Zend_Registry::get('genericFileHelper');
         $paths = $fileHelper->getTmpPath("");
         $fileRoot = $paths['real'];
     } else {
         $fileRoot = APPLICATION_PATH . '/../tmp/tmp_upload/1';
     }
     $this->_dir = $fileRoot;
 }
開發者ID:bokultis,項目名稱:kardiomedika,代碼行數:28,代碼來源:GenericMimeType.php

示例5: __construct

 /**
  * Sets validator options
  *
  * @param  string|array|Zend_Config $compression
  * @return void
  */
 public function __construct($mimetype = array())
 {
     if ($mimetype instanceof Zend_Config) {
         $mimetype = $mimetype->toArray();
     }
     $temp = array();
     $default = array('application/x-tar', 'application/x-cpio', 'application/x-debian-package', 'application/x-archive', 'application/x-arc', 'application/x-arj', 'application/x-lharc', 'application/x-lha', 'application/x-rar', 'application/zip', 'application/zoo', 'application/x-eet', 'application/x-java-pack200', 'application/x-compress', 'application/x-gzip', 'application/x-bzip2');
     if (is_array($mimetype)) {
         $temp = $mimetype;
         if (array_key_exists('magicfile', $temp)) {
             unset($temp['magicfile']);
         }
         if (array_key_exists('headerCheck', $temp)) {
             unset($temp['headerCheck']);
         }
         if (empty($temp)) {
             $mimetype += $default;
         }
     }
     if (empty($mimetype)) {
         $mimetype = $default;
     }
     parent::__construct($mimetype);
 }
開發者ID:crlang44,項目名稱:frapi,代碼行數:30,代碼來源:IsCompressed.php

示例6: __construct

 /**
  * Sets validator options
  *
  * @param  string|array|Zend_Config $mimetype
  * @return void
  */
 public function __construct($mimetype = array())
 {
     if ($mimetype instanceof Zend_Config) {
         $mimetype = $mimetype->toArray();
     }
     $temp = array();
     $default = array('image/x-quicktime', 'image/jp2', 'image/x-xpmi', 'image/x-portable-bitmap', 'image/x-portable-greymap', 'image/x-portable-pixmap', 'image/x-niff', 'image/tiff', 'image/png', 'image/x-unknown', 'image/gif', 'image/x-ms-bmp', 'application/dicom', 'image/vnd.adobe.photoshop', 'image/vnd.djvu', 'image/x-cpi', 'image/jpeg', 'image/x-ico', 'image/x-coreldraw', 'image/svg+xml');
     if (is_array($mimetype)) {
         $temp = $mimetype;
         if (array_key_exists('magicfile', $temp)) {
             unset($temp['magicfile']);
         }
         if (array_key_exists('headerCheck', $temp)) {
             unset($temp['headerCheck']);
         }
         if (empty($temp)) {
             $mimetype += $default;
         }
     }
     if (empty($mimetype)) {
         $mimetype = $default;
     }
     parent::__construct($mimetype);
 }
開發者ID:kubomikita,項目名稱:phpmydiff,代碼行數:30,代碼來源:IsImage.php


注:本文中的Zend_Validate_File_MimeType::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。