diff --git a/setup/ajax.dataloader.php b/setup/ajax.dataloader.php
index 66ab56195..fab829719 100644
--- a/setup/ajax.dataloader.php
+++ b/setup/ajax.dataloader.php
@@ -5,11 +5,51 @@
* 'file' string Name of the file to load
* 'session_status' string 'start', 'continue' or 'end'
* 'percent' integer 0..100 the percentage of completion once the file has been loaded
- */
+ */
+define('SAFE_MINIMUM_MEMORY', 32*1024*1024);
require_once('../application/utils.inc.php');
+require_once('./setuppage.class.inc.php');
+
+$iMemoryLimit = utils::ConvertToBytes(ini_get('memory_limit'));
+if ($iMemoryLimit < SAFE_MINIMUM_MEMORY)
+{
+ if (ini_set('memory_limit', SAFE_MINIMUM_MEMORY) === FALSE)
+ {
+ SetupWebPage::error("memory_limit is too small: $iMemoryLimit and can not be increased by the script itself.");
+ }
+ else
+ {
+ SetupWebPage::log("memory_limit increased from $iMemoryLimit to ".SAFE_MINIMUM_MEMORY.".");
+ }
+}
+
+function FatalErrorCatcher($sOutput)
+{
+ if ( preg_match('|
An error happened while loading the data
\n"; echo ''.$e."
\n"; SetupWebPage::log("Error - An error happened while loading the data. ".$e); +} + +if (function_exists('memory_get_peak_usage')) +{ + SetupWebPage::log("Info - loading file '$sFileName', peak memory usage. ".memory_get_peak_usage()); } - ?> diff --git a/setup/index.php b/setup/index.php index 07abf9f49..7afc7f5e4 100644 --- a/setup/index.php +++ b/setup/index.php @@ -544,6 +544,7 @@ function DisplayStep4(SetupWebPage $oP, Config $oConfig, $sAdminUser, $sAdminPwd $oP->add("\n"); // To be compatible with login page $oP->add("\n"); $oP->add("\n"); + $oP->add("\n"); $oP->add_linked_script('./jquery.progression.js'); PopulateDataFilesList($oP); diff --git a/setup/setup.js b/setup/setup.js index de99764ed..d9fc63c5f 100644 --- a/setup/setup.js +++ b/setup/setup.js @@ -103,7 +103,8 @@ function DoLoadDataAsynchronous() $('#setup').block({message: 'Loading data...