Perf: A little speed improvement

This commit is contained in:
Laurent Destailleur 2010-09-14 22:14:55 +00:00
parent cc7758b60c
commit abb31f26b5
3 changed files with 12 additions and 6 deletions

View File

@ -110,6 +110,8 @@ class InterfaceDemo
}
elseif ($action == 'USER_UPDATE_SESSION')
{
// Warning: To increase performances, this action is triggered only if
// constant MAIN_ACTIVATE_UPDATESESSIONTRIGGER is set to 1.
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'USER_CREATE')

View File

@ -486,12 +486,15 @@ if (! defined('NOLOGIN'))
}
else
{
// Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity);
if ($result < 0) { $error++; }
// End call triggers
if (! empty($conf->MAIN_ACTIVATE_UPDATESESSIONTRIGGER))
{
// Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
$interface=new Interfaces($db);
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity);
if ($result < 0) { $error++; }
// End call triggers
}
}
}

View File

@ -362,6 +362,7 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
}
else // For backward compatibility
{
dol_syslog("Your country setup use an old syntax. Reedit it in setup area.", LOG_WARNING);
include_once(DOL_DOCUMENT_ROOT.'/lib/company.lib.php');
$pays_code=getCountry($pays_id,2,$db); // This need a SQL request, but it's the old feature
$pays_label=getCountry($pays_id,0,$db); // This need a SQL request, but it's the old feature