36 public $charset_output =
'UTF-8';
38 public $tab_translate = array();
39 private $_tab_loaded = array();
41 public $cache_labels = array();
42 public $cache_currencies = array();
43 private $cache_currencies_all_loaded =
false;
46 public $errors = array();
57 if (!empty($conf->file->character_set_client)) {
58 $this->charset_output = $conf->file->character_set_client;
61 $this->dir = array($dir);
63 $this->dir = $conf->file->dol_document_root;
81 if (!empty($conf->global->MAIN_FORCELANGDIR)) {
84 foreach ($conf->file->dol_document_root as $dir) {
85 $newdir = $dir . $conf->global->MAIN_FORCELANGDIR;
86 if (!in_array($newdir, $this->dir)) {
87 $more[
'module_' . $i] = $newdir;
91 $this->dir = array_merge($more, $this->dir);
94 $this->origlang = $srclang;
96 if (empty($srclang) || $srclang ==
'auto') {
98 $langpref = empty($_SERVER[
'HTTP_ACCEPT_LANGUAGE']) ?
'' : $_SERVER[
'HTTP_ACCEPT_LANGUAGE'];
99 $langpref = preg_replace(
"/;([^,]*)/i",
"", $langpref);
100 $langpref = str_replace(
"-",
"_", $langpref);
101 $langlist = preg_split(
"/[;,]/", $langpref);
102 $codetouse = preg_replace(
'/[^_a-zA-Z]/',
'', $langlist[0]);
104 $codetouse = $srclang;
108 $langpart = explode(
"_", $codetouse);
110 if (!empty($langpart[1])) {
112 $longforshort = array(
'ar' =>
'ar_SA');
113 $longforshortexcep = array(
'ar_EG');
114 if (isset($longforshort[strtolower($langpart[0])]) && !in_array($codetouse, $longforshortexcep)) {
115 $srclang = $longforshort[strtolower($langpart[0])];
116 } elseif (!is_numeric($langpart[1])) {
117 $srclang = strtolower($langpart[0]) .
"_" . strtoupper($langpart[1]);
118 $longforlong = array(
'no_nb' =>
'nb_NO');
119 if (isset($longforlong[strtolower($srclang)])) {
120 $srclang = $longforlong[strtolower($srclang)];
123 $srclang = strtolower($langpart[0]) .
"_" . strtoupper($langpart[0]);
127 $longforshort = array(
128 'am' =>
'am_ET',
'ar' =>
'ar_SA',
'bn' =>
'bn_DB',
'el' =>
'el_GR',
'ca' =>
'ca_ES',
'cs' =>
'cs_CZ',
'en' =>
'en_US',
'fa' =>
'fa_IR',
129 'gl' =>
'gl_ES',
'he' =>
'he_IL',
'hi' =>
'hi_IN',
'ja' =>
'ja_JP',
130 'ka' =>
'ka_GE',
'km' =>
'km_KH',
'kn' =>
'kn_IN',
'ko' =>
'ko_KR',
'lo' =>
'lo_LA',
'nb' =>
'nb_NO',
'no' =>
'nb_NO',
'ne' =>
'ne_NP',
131 'sl' =>
'sl_SI',
'sq' =>
'sq_AL',
'sr' =>
'sr_RS',
'sv' =>
'sv_SE',
'uk' =>
'uk_UA',
'vi' =>
'vi_VN',
'zh' =>
'zh_CN'
133 if (isset($longforshort[strtolower($langpart[0])])) {
134 $srclang = $longforshort[strtolower($langpart[0])];
135 } elseif (!empty($langpart[0])) {
136 $srclang = strtolower($langpart[0]) .
"_" . strtoupper($langpart[0]);
142 $this->defaultlang = $srclang;
143 $this->shortlang = substr($srclang, 0, 2);
158 return $this->defaultlang;
160 return substr($this->defaultlang, 0, 2);
174 foreach ($domains as $domain) {
175 $result = $this->
load($domain);
178 } elseif ($result < 0) {
206 public function load($domain, $alt = 0, $stopafterdirection = 0, $forcelangdir =
'', $loadfromfileonly = 0, $forceloadifalreadynotfound = 0)
213 if (empty($domain)) {
217 if ($this->defaultlang ===
'none_NONE') {
223 if (empty($loadfromfileonly) && count($this->tab_translate) == 0) {
228 $newdomain = $domain;
233 if (preg_match(
'/^([^@]+)@([^@]+)$/i', $domain, $regs)) {
234 $newdomain = $regs[1];
235 $modulename = $regs[2];
240 !empty($this->_tab_loaded[$newdomain])
241 && ($this->_tab_loaded[$newdomain] != 2 || empty($forceloadifalreadynotfound))
248 $langofdir = (empty($forcelangdir) ? $this->defaultlang : $forcelangdir);
251 $langarray = explode(
'_', $langofdir);
252 if ($alt < 1 && isset($langarray[1]) && (strtolower($langarray[0]) == strtolower($langarray[1]) || in_array(strtolower($langofdir), array(
'el_gr')))) {
255 if ($alt < 2 && strtolower($langofdir) ==
'en_us') {
259 if (empty($langofdir)) {
260 dol_syslog(
"Error: " . get_class($this) .
"::load was called for domain=" . $domain .
" but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
264 foreach ($this->dir as $searchdir) {
266 $file_lang = $searchdir . ($modulename ?
'/' . $modulename :
'') .
"/langs/" . $langofdir .
"/" . $newdomain .
".lang";
270 $filelangexists = @is_file($file_lang_osencoded);
275 if ($filelangexists) {
282 if (isModEnabled(
'memcached') && !empty($conf->global->MEMCACHED_SERVER)) {
283 $usecachekey = $newdomain .
'_' . $langofdir .
'_' . md5($file_lang);
284 } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
286 $usecachekey = $newdomain;
293 require_once DOL_DOCUMENT_ROOT .
'/core/lib/memory.lib.php';
295 if (is_array($tmparray) && count($tmparray)) {
296 $this->tab_translate += $tmparray;
307 if ($fp = @fopen($file_lang,
"rt")) {
309 $tabtranslatedomain = array();
317 while ($line = fscanf($fp,
"%[^= ]%*[ =]%[^\n\r]")) {
318 if (isset($line[1])) {
319 list($key, $value) = $line;
322 if (empty($this->tab_translate[$key])) {
323 if ($key ==
'DIRECTION') {
324 if ($alt < 2 || empty($this->tab_translate[$key])) {
325 $this->tab_translate[$key] = $value;
326 if ($stopafterdirection) {
328 } elseif ($usecachekey) {
329 $tabtranslatedomain[$key] = $value;
332 } elseif ($key[0] ==
'#') {
336 $this->tab_translate[$key] = str_replace(array(
'\\n',
'\\\\s'), array(
"\n",
'\s'), $value);
338 $tabtranslatedomain[$key] = $value;
349 if ($usecachekey && count($tabtranslatedomain)) {
350 $ressetcache =
dol_setcache($usecachekey, $tabtranslatedomain);
351 if ($ressetcache < 0) {
352 $error =
'Failed to set cache for usecachekey=' . $usecachekey .
' result=' . $ressetcache;
357 if (empty($conf->global->MAIN_FORCELANGDIR)) {
369 $langofdir = strtolower($langarray[0]) .
'_' . strtoupper($langarray[0]);
370 if ($langofdir ==
'el_EL') {
371 $langofdir =
'el_GR';
373 if ($langofdir ==
'ar_AR') {
374 $langofdir =
'ar_SA';
376 $this->
load($domain, $alt + 1, $stopafterdirection, $langofdir);
383 $langofdir =
'en_US';
384 $this->
load($domain, $alt + 1, $stopafterdirection, $langofdir);
390 $this->_tab_loaded[$newdomain] = 1;
393 if (empty($this->_tab_loaded[$newdomain])) {
394 $this->_tab_loaded[$newdomain] = 2;
400 if (empty($loadfromfileonly)) {
401 $overwritekey =
'MAIN_OVERWRITE_TRANS_' . $this->defaultlang;
402 if (!empty($conf->global->$overwritekey)) {
404 $tmparray = explode(
',', $conf->global->$overwritekey);
405 foreach ($tmparray as $tmp) {
406 $tmparray2 = explode(
':', $tmp);
407 if (!empty($tmparray2[1])) {
408 $this->tab_translate[$tmparray2[0]] = $tmparray2[1];
416 !empty($this->tab_translate[
"SeparatorDecimal"]) && !empty($this->tab_translate[
"SeparatorThousand"])
417 && $this->tab_translate[
"SeparatorDecimal"] == $this->tab_translate[
"SeparatorThousand"]
419 $this->tab_translate[
"SeparatorThousand"] =
'';
441 $domain =
'database';
450 $newdomain = $domain;
453 if (!empty($this->_tab_loaded[$newdomain])) {
458 $this->_tab_loaded[$newdomain] = 1;
461 $langofdir = $this->defaultlang;
463 if (empty($langofdir)) {
464 dol_syslog(
"Error: " . get_class($this) .
"::loadFromDatabase was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
474 if (isModEnabled(
'memcached') && !empty($conf->global->MEMCACHED_SERVER)) {
475 $usecachekey = $newdomain .
'_' . $langofdir;
476 } elseif (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02)) {
478 $usecachekey = $newdomain;
485 require_once DOL_DOCUMENT_ROOT .
'/core/lib/memory.lib.php';
487 if (is_array($tmparray) && count($tmparray)) {
488 $this->tab_translate += $tmparray;
496 if (!$found && !empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION)) {
498 $sql =
"SELECT transkey, transvalue FROM ".$db->prefix().
"overwrite_trans where (lang='".$db->escape($this->defaultlang).
"' OR lang IS NULL)";
499 $sql .=
" AND entity IN (0, ".getEntity(
'overwrite_trans').
")";
500 $sql .= $db->order(
"lang",
"DESC");
502 $resql = $db->query($sql);
505 $num = $db->num_rows($resql);
508 $tabtranslatedomain = array();
513 $obj = $db->fetch_object($resql);
515 $key = $obj->transkey;
516 $value = $obj->transvalue;
519 if (empty($this->tab_translate[$key])) {
521 $this->tab_translate[$key] = str_replace(array(
'\\n',
'\\\\s'), array(
"\n",
'\s'), $value);
524 $tabtranslatedomain[$key] = $value;
535 if ($usecachekey && count($tabtranslatedomain)) {
536 $ressetcache =
dol_setcache($usecachekey, $tabtranslatedomain);
537 if ($ressetcache < 0) {
538 $error =
'Failed to set cache for usecachekey=' . $usecachekey .
' result=' . $ressetcache;
549 $this->_tab_loaded[$newdomain] = 1;
552 if (empty($this->_tab_loaded[$newdomain])) {
553 $this->_tab_loaded[$newdomain] = 2;
567 return $this->_tab_loaded[$domain];
585 if (!is_string($key)) {
587 return 'ErrorBadValueForParamNotAString';
592 if (preg_match(
'/^Civility([0-9A-Z]+)$/i', $key, $reg)) {
593 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_civility',
'code',
'label');
594 } elseif (preg_match(
'/^Currency([A-Z][A-Z][A-Z])$/i', $key, $reg)) {
595 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_currencies',
'code_iso',
'label');
596 } elseif (preg_match(
'/^SendingMethod([0-9A-Z]+)$/i', $key, $reg)) {
597 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_shipment_mode',
'code',
'libelle');
598 } elseif (preg_match(
'/^PaymentType(?:Short)?([0-9A-Z]+)$/i', $key, $reg)) {
599 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_paiement',
'code',
'libelle',
'', 1);
600 } elseif (preg_match(
'/^OppStatus([0-9A-Z]+)$/i', $key, $reg)) {
601 $newstr = $this->
getLabelFromKey($db, $reg[1],
'c_lead_status',
'code',
'label');
602 } elseif (preg_match(
'/^OrderSource([0-9A-Z]+)$/i', $key, $reg)) {
630 public function trans($key, $param1 =
'', $param2 =
'', $param3 =
'', $param4 =
'', $maxsize = 0)
634 if (!empty($this->tab_translate[$key])) {
635 $str = $this->tab_translate[$key];
638 $replacekey =
'MAIN_REPLACE_TRANS_' . $this->defaultlang;
639 if (!empty($conf->global->$replacekey)) {
640 $tmparray = explode(
';', $conf->global->$replacekey);
641 foreach ($tmparray as $tmp) {
642 $tmparray2 = explode(
':', $tmp);
643 $str = preg_replace(
'/' . preg_quote($tmparray2[0]) .
'/', $tmparray2[1], $str);
650 array(
'"',
'<b>',
'</b>',
'<u>',
'</u>',
'<i',
'</i>',
'<center>',
'</center>',
'<strong>',
'</strong>',
'<a ',
'</a>',
'<br>',
'<span',
'</span>',
'< ',
'>'),
651 array(
'__quot__',
'__tagb__',
'__tagbend__',
'__tagu__',
'__taguend__',
'__tagi__',
'__tagiend__',
'__tagcenter__',
'__tagcenterend__',
'__tagb__',
'__tagbend__',
'__taga__',
'__tagaend__',
'__tagbr__',
'__tagspan__',
'__tagspanend__',
'__ltspace__',
'__gt__'),
655 if (strpos($key,
'Format') !== 0) {
657 $str = sprintf($str, $param1, $param2, $param3, $param4);
664 $str = htmlentities($str, ENT_COMPAT, $this->charset_output);
668 array(
'__quot__',
'__tagb__',
'__tagbend__',
'__tagu__',
'__taguend__',
'__tagi__',
'__tagiend__',
'__tagcenter__',
'__tagcenterend__',
'__taga__',
'__tagaend__',
'__tagbr__',
'__tagspan__',
'__tagspanend__',
'__ltspace__',
'__gt__'),
669 array(
'"',
'<b>',
'</b>',
'<u>',
'</u>',
'<i',
'</i>',
'<center>',
'</center>',
'<a ',
'</a>',
'<br>',
'<span',
'</span>',
'< ',
'>'),
699 public function transnoentities($key, $param1 =
'', $param2 =
'', $param3 =
'', $param4 =
'', $param5 =
'')
724 if (!empty($this->tab_translate[$key])) {
725 $str = $this->tab_translate[$key];
728 $replacekey =
'MAIN_REPLACE_TRANS_' . $this->defaultlang;
729 if (!empty($conf->global->$replacekey)) {
730 $tmparray = explode(
';', $conf->global->$replacekey);
731 foreach ($tmparray as $tmp) {
732 $tmparray2 = explode(
':', $tmp);
733 $str = preg_replace(
'/' . preg_quote($tmparray2[0]) .
'/', $tmparray2[1], $str);
737 if (!preg_match(
'/^Format/', $key)) {
739 $str = sprintf($str, $param1, $param2, $param3, $param4, $param5);
762 if (!empty($this->tab_translate[
"$str$countrycode"])) {
763 return $this->
trans(
"$str$countrycode");
765 return $this->
trans($str);
780 if (!empty($this->tab_translate[
"$str$countrycode"])) {
797 if ($pagecodefrom ==
'ISO-8859-1' && $this->charset_output ==
'UTF-8') {
798 $str = utf8_encode($str);
800 if ($pagecodefrom ==
'UTF-8' && $this->charset_output ==
'ISO-8859-1') {
801 $str = utf8_decode(str_replace(
'€', chr(128), $str));
823 $this->
load(
"languages");
826 $handle = opendir($langdir .
"/langs");
827 $langs_available = array();
828 while ($dir = trim(readdir($handle))) {
830 if (preg_match(
'/^([a-z]+)_([A-Z]+)/i', $dir, $regs)) {
833 $arrayofspecialmainlanguages = array(
862 if (strtolower($regs[1]) != strtolower($regs[2]) && !in_array($dir, $arrayofspecialmainlanguages)) {
867 if (!empty($conf->global->MAIN_LANGUAGES_ALLOWED) && !in_array($dir, explode(
',', $conf->global->MAIN_LANGUAGES_ALLOWED))) {
872 $langs_available[$dir] = $dir;
875 if ($usecode == 1 || !empty($conf->global->MAIN_SHOW_LANGUAGE_CODE)) {
876 $langs_available[$dir] = $dir .
': ' .
dol_trunc($this->
trans(
'Language_' . $dir), $maxlength);
878 $langs_available[$dir] = $this->
trans(
'Language_' . $dir);
881 $langs_available[$dir] = str_replace(
' (United States)',
'', $langs_available[$dir]);
885 return $langs_available;
901 foreach ($this->dir as $searchdir) {
902 if (is_readable(
dol_osencode($searchdir .
"/langs/" . $this->defaultlang .
"/" . $filename))) {
908 if ($this->defaultlang !=
"en_US") {
909 $filenamealt = $searchdir .
"/langs/en_US/" . $filename;
937 $newnumber = $number;
939 $dirsubstitutions = array_merge(array(), $conf->modules_parts[
'substitutions']);
940 foreach ($dirsubstitutions as $reldir) {
945 if (!is_dir($newdir)) {
949 $fonc =
'numberwords';
950 if (
file_exists($newdir .
'/functions_' . $fonc .
'.lib.php')) {
951 include_once $newdir .
'/functions_' . $fonc .
'.lib.php';
952 if (function_exists(
'numberwords_getLabelFromNumber')) {
953 $newnumber = numberwords_getLabelFromNumber($this, $number, $isamount);
978 public function getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect =
'', $filteronentity = 0)
985 if (preg_match(
'/[^0-9A-Z_]/i', $tablename) || preg_match(
'/[^0-9A-Z_]/i', $fieldkey) || preg_match(
'/[^0-9A-Z_]/i', $fieldlabel)) {
986 $this->error =
'Bad value for parameter tablename, fieldkey or fieldlabel';
994 if ($tmp != $key && $tmp !=
'ErrorBadValueForParamNotAString') {
999 if (isset($this->cache_labels[$tablename][$key])) {
1000 return $this->cache_labels[$tablename][$key];
1004 $sql =
"SELECT " . $fieldlabel .
" as label";
1005 $sql .=
" FROM " . $db->prefix() . $tablename;
1006 $sql .=
" WHERE " . $fieldkey .
" = '" . $db->escape($keyforselect ? $keyforselect : $key) .
"'";
1007 if ($filteronentity) {
1008 $sql .=
" AND entity IN (" .
getEntity($tablename) .
')';
1010 dol_syslog(get_class($this) .
'::getLabelFromKey', LOG_DEBUG);
1011 $resql = $db->query($sql);
1013 $obj = $db->fetch_object($resql);
1015 $this->cache_labels[$tablename][$key] = $obj->label;
1017 $this->cache_labels[$tablename][$key] = $key;
1021 return $this->cache_labels[$tablename][$key];
1023 $this->error = $db->lasterror();
1042 if (in_array($currency_code, array(
'USD'))) {
1043 return $symbol . $amount;
1045 return $amount . $symbol;
1059 $currency_sign =
'';
1061 if (function_exists(
"mb_convert_encoding")) {
1064 if (isset($this->cache_currencies[$currency_code]) && !empty($this->cache_currencies[$currency_code][
'unicode']) && is_array($this->cache_currencies[$currency_code][
'unicode'])) {
1065 foreach ($this->cache_currencies[$currency_code][
'unicode'] as $unicode) {
1066 $currency_sign .= mb_convert_encoding(
"&#" . $unicode .
";",
"UTF-8",
'HTML-ENTITIES');
1071 return ($currency_sign ? $currency_sign : $currency_code);
1084 if ($this->cache_currencies_all_loaded) {
1087 if (!empty($currency_code) && isset($this->cache_currencies[$currency_code])) {
1091 $sql =
"SELECT code_iso, label, unicode";
1092 $sql .=
" FROM " . $db->prefix() .
"c_currencies";
1093 $sql .=
" WHERE active = 1";
1094 if (!empty($currency_code)) {
1095 $sql .=
" AND code_iso = '" . $db->escape($currency_code) .
"'";
1099 dol_syslog(get_class($this) .
'::loadCacheCurrencies', LOG_DEBUG);
1100 $resql = $db->query($sql);
1102 $this->
load(
"dict");
1104 if (!empty($currency_code)) {
1105 foreach ($this->cache_currencies as $key => $val) {
1106 $label[$key] = $val[
'label'];
1110 $num = $db->num_rows($resql);
1113 $obj = $db->fetch_object($resql);
1116 $this->cache_currencies[$obj->code_iso][
'label'] = ($obj->code_iso && $this->
trans(
"Currency" . $obj->code_iso) !=
"Currency" . $obj->code_iso ? $this->
trans(
"Currency" . $obj->code_iso) : ($obj->label !=
'-' ? $obj->label :
''));
1117 $this->cache_currencies[$obj->code_iso][
'unicode'] = (array) json_decode((empty($obj->unicode) ?
'' : $obj->unicode),
true);
1118 $label[$obj->code_iso] = $this->cache_currencies[$obj->code_iso][
'label'];
1122 if (empty($currency_code)) {
1123 $this->cache_currencies_all_loaded =
true;
1128 array_multisort($label, SORT_ASC, $this->cache_currencies);
1147 $substitutionarray = array();
1149 foreach ($this->tab_translate as $code => $label) {
1150 $substitutionarray[
'lang_' . $code] = $label;
1151 $substitutionarray[
'__(' . $code .
')__'] = $label;
1154 return $substitutionarray;
Class to manage translations.
transnoentities($key, $param1='', $param2='', $param3='', $param4='', $param5='')
Return translated value of a text string If there is no match for this text, we look in alternative f...
transnoentitiesnoconv($key, $param1='', $param2='', $param3='', $param4='', $param5='')
Return translated value of a text string If there is no match for this text, we look in alternative f...
getTradFromKey($key)
Return translated value of key for special keys ("Currency...", "Civility...", ......
getLabelFromNumber($number, $isamount='')
Return full text translated to language label for a key.
getCurrencyAmount($currency_code, $amount)
Return a currency code into its symbol.
get_translations_for_substitutions()
Return an array with content of all loaded translation keys (found into this->tab_translate) so we ge...
getLabelFromKey($db, $key, $tablename, $fieldkey, $fieldlabel, $keyforselect='', $filteronentity=0)
Return a label for a key.
get_available_languages($langdir=DOL_DOCUMENT_ROOT, $maxlength=0, $usecode=0, $mainlangonly=0)
Return list of all available languages.
loadCacheCurrencies($currency_code)
Load into the cache this->cache_currencies, all currencies.
setDefaultLang($srclang='en_US')
Set accessor for this->defaultlang.
file_exists($filename, $searchalt=0)
Return if a filename $filename exists for current language (or alternate language)
transcountry($str, $countrycode)
Return translation of a key depending on country.
isLoaded($domain)
Get information with result of loading data for domain.
load($domain, $alt=0, $stopafterdirection=0, $forcelangdir='', $loadfromfileonly=0, $forceloadifalreadynotfound=0)
Load translation key-value for a particular file, into a memory array.
trans($key, $param1='', $param2='', $param3='', $param4='', $maxsize=0)
Return text translated of text received as parameter (and encode it into HTML) If there is no match f...
transcountrynoentities($str, $countrycode)
Retourne la version traduite du texte passe en parametre complete du code pays.
getCurrencySymbol($currency_code, $forceloadall=0)
Return a currency code into its symbol.
loadLangs($domains)
Load translation files.
convToOutputCharset($str, $pagecodefrom='UTF-8')
Convert a string into output charset (this->charset_output that should be defined to conf->file->char...
loadFromDatabase($db)
Load translation key-value from database into a memory array.
getDefaultLang($mode=0)
Return active language code for current user It's an accessor for this->defaultlang.
__construct($dir, $conf)
Constructor.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_setcache($memoryid, $data, $expire=0)
Save data into a memory area shared by all users, all sessions on server.
dol_getcache($memoryid)
Read a memory area shared by all users, all sessions on server.