Work on 10MB chunks if no memory limit is set (bug #1399477).

This commit is contained in:
Michal Čihař
2006-01-09 10:24:20 +00:00
parent 32a39388f1
commit 3bac98ef23
2 changed files with 11 additions and 1 deletions

View File

@@ -171,7 +171,13 @@ if (!empty($bkm_label) && !empty($import_text)) {
// We can not read all at once, otherwise we can run out of memory
$memory_limit = trim(@ini_get('memory_limit'));
// 2 MB as default
if (empty($memory_limit)) $memory_limit = 2 * 1024 * 1024;
if (empty($memory_limit)) {
$memory_limit = 2 * 1024 * 1024;
}
// In case no memory limit we work on 10MB chunks
if ($memory_limit = -1) {
$memory_limit = 10 * 1024 * 1024;
}
// Calculate value of the limit
if (strtolower(substr($memory_limit, -1)) == 'm') $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024;