/** * Returns the maximum filesize to upload * * @param bool return as formatted string * @return mixed */ public static function getMaxUploadSize($_asString = false, $_value = null) { $maxUpload = ConfigUtil::ini2bytes(ini_get("upload_max_filesize")); $maxPost = ConfigUtil::ini2bytes(ini_get("post_max_size")); if ($_value != null) { if ($_value < $maxUpload) { $maxUpload = $_value; } if ($_value < $maxPost) { $maxPost = $_value; } } if ($maxPost < $maxUpload) { $maxUpload = $maxPost; } if ($_asString) { return Formatter::fileSize($maxUpload); } else { return $maxUpload; } }