summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid45142012-02-20 23:04:58 (GMT)
committer Mike Ryan2012-02-20 23:04:58 (GMT)
commit551e40df0455dfc5caa9bb5cec813c025898ca63 (patch)
treedd206ed21cc714400d43bcac5db1f34b4429cd5d
parentdb80229016c8c8f2f27e7cb69fd0a54fc3cb2499 (diff)
Issue #1447368 by David4514: Handle purely numeric PHP memory_limit7.x-2.3-rc1
-rw-r--r--CHANGELOG.txt1
-rw-r--r--includes/base.inc26
2 files changed, 15 insertions, 12 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 1dcba62..041f4fd 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -36,6 +36,7 @@ Features and enhancements
- #1254398 - Prevent accidental emailing during migration.
Bug fixes
+- #1447368 - Handle purely numeric PHP memory_limit.
- #1432802 - Default $options to prevent PHP 5.4 error.
- #1333656 - Remove content type/fields when uninstalling migrate_example_baseball.
- #1416012 - Cleanly handle NULL source key values in saveIDMapping().
diff --git a/includes/base.inc b/includes/base.inc
index bbada55..0721c8f 100644
--- a/includes/base.inc
+++ b/includes/base.inc
@@ -314,18 +314,20 @@ abstract class MigrationBase {
$this->memoryLimit = PHP_INT_MAX;
}
else {
- $last = strtolower($limit[strlen($limit)-1]);
- switch ($last) {
- case 'g':
- $limit *= 1024;
- case 'm':
- $limit *= 1024;
- case 'k':
- $limit *= 1024;
- break;
- default:
- throw new Exception(t('Invalid PHP memory_limit !limit',
- array('!limit' => $limit)));
+ if (!is_numeric($limit)) {
+ $last = strtolower($limit[strlen($limit)-1]);
+ switch ($last) {
+ case 'g':
+ $limit *= 1024;
+ case 'm':
+ $limit *= 1024;
+ case 'k':
+ $limit *= 1024;
+ break;
+ default:
+ throw new Exception(t('Invalid PHP memory_limit !limit',
+ array('!limit' => $limit)));
+ }
}
$this->memoryLimit = $limit;
}