mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
#1352 - Better handling of memory limit
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@47829 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
fcd0760159
commit
56e46683f7
21
main.php
21
main.php
@ -50,6 +50,27 @@ if(isset($_REQUEST['trace'])) {
|
||||
apd_set_pprof_trace();
|
||||
}
|
||||
|
||||
// Ensure we have enough memory
|
||||
$memString = ini_get("memory_limit");
|
||||
switch(strtolower(substr($memString,-1))) {
|
||||
case "k":
|
||||
$memory = round(substr($memString,0,-1)*1024);
|
||||
break;
|
||||
case "m":
|
||||
$memory = round(substr($memString,0,-1)*1024*1024);
|
||||
break;
|
||||
case "g":
|
||||
$memory = round(substr($memString,0,-1)*1024*1024*1024);
|
||||
break;
|
||||
default:
|
||||
$memory = round($memString);
|
||||
}
|
||||
// Check we have at least 32M
|
||||
if($memory < (32 * 1024 * 1024)) {
|
||||
// Increase memory limit
|
||||
ini_set('memory_limit', '32M');
|
||||
}
|
||||
|
||||
|
||||
require_once("core/ManifestBuilder.php");
|
||||
require_once("core/ClassInfo.php");
|
||||
|
Loading…
x
Reference in New Issue
Block a user