本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: setMaxFileSize
/**
* Sets the maximum file size of the form
*
* @param integer $size
* @return integer
*/
public function setMaxFileSize($size)
{
self::$_maxFileSize = $size;
return $this;
}