diff --git a/lib/pdepend b/lib/pdepend index a13a677cc..0628e7d46 160000 --- a/lib/pdepend +++ b/lib/pdepend @@ -1 +1 @@ -Subproject commit a13a677cc3b29c59486e075349f4ac7271e33ae4 +Subproject commit 0628e7d4648ad1fa73476f16a096db47a635630c diff --git a/setup b/setup index 787e98ca5..771305048 160000 --- a/setup +++ b/setup @@ -1 +1 @@ -Subproject commit 787e98ca558d1de9c8172b1298512513a0e3fb9e +Subproject commit 7713050481f0cd17f2b37f96ed7e3b73a3c16f4e diff --git a/src/bin/phpmd.php b/src/bin/phpmd.php index 1fc4cb638..8c2735c3b 100755 --- a/src/bin/phpmd.php +++ b/src/bin/phpmd.php @@ -12,8 +12,19 @@ ); } -// Disable memory_limit -ini_set('memory_limit', -1); +// Allow as much memory as possible by default +if (extension_loaded('suhosin') && is_numeric(ini_get('suhosin.memory_limit'))) { + $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); +} // Check php setup for cli arguments if (!isset($_SERVER['argv']) && !isset($argv)) { diff --git a/src/conf/package.xml b/src/conf/package.xml index 4934276d1..9bcf00334 100644 --- a/src/conf/package.xml +++ b/src/conf/package.xml @@ -348,7 +348,7 @@ PHP_Depend pear.pdepend.org - 1.0.2 + 1.0.3 pcre diff --git a/src/site/docx/changes.xml b/src/site/docx/changes.xml index 330ca4945..741249b67 100644 --- a/src/site/docx/changes.xml +++ b/src/site/docx/changes.xml @@ -1,5 +1,6 @@ - @@ -9,6 +10,16 @@ + + + Alert disable memory_limit + +