예제 #1
0
 protected function checkMaxPostSizeExceeded()
 {
     if (empty($_POST) && empty($_FILES)) {
         $postMaxSize = Number::configSizeToMB(ini_get('post_max_size'));
         $uploadMaxFileSize = Number::configSizeToMB(ini_get('upload_max_filesize'));
         $maxFileSize = $postMaxSize > $uploadMaxFileSize ? $uploadMaxFileSize : $postMaxSize;
         throw new Exception(sprintf(GO::t('maybeMaxUploadExceeded'), $maxFileSize));
     }
 }
예제 #2
0
파일: GO.php 프로젝트: ajaboa/crmpuan
 /**
  * Set the memory limit in MB if the given value is higher then the current limit.
  * 
  * Note: this may be blocked by the suhosin PHP module
  * 
  * @param int $mb
  * @return boolean
  */
 public static function setMemoryLimit($mb)
 {
     $max = \GO\Base\Util\Number::configSizeToMB(ini_get("memory_limit"));
     if ($mb > $max) {
         return ini_set("memory_limit", $mb . 'M');
     } else {
         return true;
     }
 }