Permalink
Browse files

BUG: Fix increase_memory_limit_to() to reduce installation errors.

increase_memory_limit_to() was broken a while ago, and this causes a lot of problems for people trying to install on environments where the memory limit is 32M.
  • Loading branch information...
1 parent 2a3d387 commit 6ef4f9ad3fafb3ecce93bf6f49270cf6960ce597 @sminnee sminnee committed Jun 26, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/Core.php
View
@@ -409,7 +409,8 @@ function increase_memory_limit_to($memoryLimit = -1) {
// Check hard maximums
$max = get_increase_memory_limit_max();
- if($max != -1 && translate_memstring($memoryLimit) > translate_memstring($max)) return false;
+
+ if($max && $max != -1 && trANSLATE_MEMSTRING($memoryLimit) > translate_memstring($max)) return false;
// Increase the memory limit if it's too low
if($memoryLimit == -1 || translate_memstring($memoryLimit) > translate_memstring($curLimit)) {

2 comments on commit 6ef4f9a

@caffeineinc
caffeineinc commented on 6ef4f9a Nov 9, 2016 edited

trANSLATE_MEMSTRING isn't actually a function. Just commenting as a note to make a pull request. :)

@kinglozzer
Member

@caffeineinc https://github.com/silverstripe/silverstripe-framework/blob/6ef4f9ad3fafb3ecce93bf6f49270cf6960ce597/core/Core.php#L458-L470. Thankfully PHP is case-insensitive for function names 😉 I think the casing has been fixed now anyway

Please sign in to comment.