Skip to content

Commit

Permalink
Perf: Avoid makign a "desc table" for each row we import (for this we
Browse files Browse the repository at this point in the history
are using a global cache array).
  • Loading branch information
eldy committed Mar 19, 2014
1 parent 2cced0b commit dc7db87
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions htdocs/imports/import.php
Expand Up @@ -482,7 +482,7 @@
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 '<table width="100%" class="border">';
Expand Down Expand Up @@ -1307,7 +1307,10 @@
$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)
{
Expand Down Expand Up @@ -1621,7 +1624,10 @@
$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++;
Expand Down

0 comments on commit dc7db87

Please sign in to comment.