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)); } }
/** * 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; } }