diff --git a/setup b/setup index f45722337..787e98ca5 160000 --- a/setup +++ b/setup @@ -1 +1 @@ -Subproject commit f45722337dca06ba0a744afa454792c842f4d49e +Subproject commit 787e98ca558d1de9c8172b1298512513a0e3fb9e diff --git a/src/bin/pdepend.php b/src/bin/pdepend.php index d83c27626..2ad9b0241 100755 --- a/src/bin/pdepend.php +++ b/src/bin/pdepend.php @@ -54,7 +54,18 @@ require_once 'PHP/Depend/Autoload.php'; // Allow as much memory as possible by default -ini_set('memory_limit', -1); +if (extension_loaded('suhosin')) { + $limit = ini_get('memory_limit'); + if (preg_match('(^(\d+)([BKMGT]))', $limit, $match)) { + $shift = array('B' => 0, 'K' => 10, 'M' => 20, 'G' => 30, 'T' => 40); + $limit = ($match[1] * (1 << $shift[$match[2]])); + } + if (ini_get('suhosin.memory_limit') > $limit) { + ini_set('memory_limit', ini_get('suhosin.memory_limit')); + } +} else { + ini_set('memory_limit', -1); +} // Disable E_STRICT for all PHP versions < 5.3.x if (version_compare(phpversion(), '5.3.0')) { diff --git a/src/site/docx/changes.xml b/src/site/docx/changes.xml index f21a6279b..4fc782215 100644 --- a/src/site/docx/changes.xml +++ b/src/site/docx/changes.xml @@ -9,6 +9,16 @@ + + + Alert disable memory_limit + +