Issues (1369)

includes/functions/lng_language.php (1 issue)

Severity
1
<?php
2
3
// ----------------------------------------------------------------------------------------------------------------
4
function lng_try_filepath($path, $file_path_relative)
5
{
6
  $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative;
7
  return file_exists($file_path) ? $file_path : false;
8
}
9
10
function lng_die_not_an_object()
11
{
12
  print('Ошибка - $lang не объект! Сообщите Администратору сервера и приложите содержимое страницы');
13
  $trace = debug_backtrace();
14
  unset($trace[0]);
15
  pdump($trace);
16
  return die();
0 ignored issues
show
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
17
}
18
19
// ----------------------------------------------------------------------------------------------------------------
20
function lng_include($filename, $path = '', $ext = '.mo.php')
21
{
22
  global $lang;
23
  return is_object($lang) ? $lang->lng_include($filename, $path, $ext) : lng_die_not_an_object();
24
}
25
26
function lng_get_list()
27
{
28
  global $lang;
29
  return is_object($lang) ? $lang->lng_get_list() : lng_die_not_an_object();
30
}
31
32
function lng_get_info($entry)
33
{
34
  global $lang;
35
  return is_object($lang) ? $lang->lng_get_info($entry) : lng_die_not_an_object();
36
}
37
38
function lng_switch($language_new)
39
{
40
  global $lang;
41
  return is_object($lang) ? $lang->lng_switch($language_new) : lng_die_not_an_object();
42
}
43
44
function lng_load_i18n($i18n)
45
{
46
  global $lang;
47
  return is_object($lang) ? $lang->lng_load_i18n($i18n) : lng_die_not_an_object();
48
}
49