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') 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); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
} }
elseif ($action == 'USER_CREATE') elseif ($action == 'USER_CREATE')

View File

@ -486,12 +486,15 @@ if (! defined('NOLOGIN'))
} }
else else
{ {
// Call triggers if (! empty($conf->MAIN_ACTIVATE_UPDATESESSIONTRIGGER))
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); {
$interface=new Interfaces($db); // Call triggers
$result=$interface->run_triggers('USER_UPDATE_SESSION',$user,$user,$langs,$conf,$conf->entity); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
if ($result < 0) { $error++; } $interface=new Interfaces($db);
// End call triggers $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 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'); 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_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 $pays_label=getCountry($pays_id,0,$db); // This need a SQL request, but it's the old feature