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


PHP Zend_Form_Element_File::_maxFileSize方法代碼示例

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


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

示例1: setMaxFileSize

 /**
  * Sets the maximum file size of the form
  *
  * @param  integer $size
  * @return integer
  */
 public function setMaxFileSize($size)
 {
     $ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
     $max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
     if ($max > -1 && $size > $max) {
         trigger_error("Your 'upload_max_filesize' config setting limits the maximum filesize to '{$max}'. You tried to set '{$size}'.", E_USER_NOTICE);
         $size = $max;
     }
     if ($ini > -1 && $size > $ini) {
         trigger_error("Your 'post_max_size' config setting limits the maximum filesize to '{$ini}'. You tried to set '{$size}'.", E_USER_NOTICE);
         $size = $ini;
     }
     self::$_maxFileSize = $size;
     return $this;
 }
開發者ID:BGCX067,項目名稱:f1n4l-pr0j3c7-f0r-t3h-0n35-wh0-n33d-17-svn-to-git,代碼行數:21,代碼來源:File.php

示例2: setMaxFileSize

 /**
  * Sets the maximum file size of the form
  *
  * @param  integer $size
  * @return integer
  */
 public function setMaxFileSize($size)
 {
     $ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
     $mem = $this->_convertIniToInteger(trim(ini_get('memory_limit')));
     $max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
     if ($max > -1 && $size > $max) {
         trigger_error("Your 'upload_max_filesize' config setting allows only {$max}. You set {$size}.", E_USER_NOTICE);
         $size = $max;
     }
     if ($ini > -1 && $size > $ini) {
         trigger_error("Your 'post_max_size' config setting allows only {$ini}. You set {$size}.", E_USER_NOTICE);
         $size = $ini;
     }
     if ($mem > -1 && $size > $mem) {
         trigger_error("Your 'memory_limit' config setting allows only {$mem}. You set {$size}.", E_USER_NOTICE);
         $size = $mem;
     }
     self::$_maxFileSize = $size;
     return $this;
 }
開發者ID:H38uS,項目名稱:Impulsion,代碼行數:26,代碼來源:File.php

示例3: setMaxFileSize

 /**
  * Sets the maximum file size of the form
  *
  * @param  integer $size
  * @return integer
  */
 public function setMaxFileSize($size)
 {
     $ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
     $mem = $this->_convertIniToInteger(trim(ini_get('memory_limit')));
     $max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
     if ($max > -1 and $size > $max) {
         trigger_error("Your 'upload_max_filesize' config setting allows only {$max}. You set {$size}.", E_USER_ERROR);
     }
     if ($ini > -1 and $size > $ini) {
         trigger_error("Your 'post_max_size' config setting allows only {$ini}. You set {$size}.", E_USER_ERROR);
     }
     if ($mem > -1 and $ini > $mem) {
         trigger_error("Your 'post_max_size' config settings exceeds the 'memory_limit' setting. You should fix this.", E_USER_ERROR);
     }
     self::$_maxFileSize = $size;
     return $this;
 }
開發者ID:dragonlet,項目名稱:clearhealth,代碼行數:23,代碼來源:File.php

示例4: setMaxFileSize

 /**
  * Sets the maximum file size of the form
  *
  * @param  integer $size
  * @return integer
  */
 public function setMaxFileSize($size)
 {
     self::$_maxFileSize = $size;
     return $this;
 }
開發者ID:lortnus,項目名稱:zf1,代碼行數:11,代碼來源:File.php


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