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

@ -485,6 +485,8 @@ if (! defined('NOLOGIN'))
exit; exit;
} }
else else
{
if (! empty($conf->MAIN_ACTIVATE_UPDATESESSIONTRIGGER))
{ {
// Call triggers // Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
@ -494,6 +496,7 @@ if (! defined('NOLOGIN'))
// End call triggers // End call triggers
} }
} }
}
// Is it a new session ? // Is it a new session ?
if (! isset($_SESSION["dol_login"])) if (! isset($_SESSION["dol_login"]))

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