From dc7db87ee53571eba11283044dee2efe5c1abc8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 19 Mar 2014 20:23:29 +0100 Subject: [PATCH] Perf: Avoid makign a "desc table" for each row we import (for this we are using a global cache array). --- htdocs/imports/import.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 6bb65e258c9..e824c964cb0 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -482,7 +482,7 @@ if ($step == 3 && $datatoimport) if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - + } print ''; @@ -1307,7 +1307,10 @@ if ($step == 5 && $datatoimport) $result=$obj->import_open_file($pathfile,$langs); if ($result > 0) { - $sourcelinenb=0; $endoffile=0; + global $tablewithentity_cache; + $tablewithentity_cache=array(); + $sourcelinenb=0; $endoffile=0; + // Loop on each input file record while ($sourcelinenb < $nboflines && ! $endoffile) { @@ -1621,7 +1624,10 @@ if ($step == 6 && $datatoimport) $result=$obj->import_open_file($pathfile,$langs); if ($result > 0) { + global $tablewithentity_cache; + $tablewithentity_cache=array(); $sourcelinenb=0; $endoffile=0; + while ($sourcelinenb < $nboflines && ! $endoffile) { $sourcelinenb++;