* Simplify lang include

I would skip the unset and leave it to the GC
This commit is contained in:
Momchil Bozhinov
2021-01-20 09:46:58 +02:00
parent 02b1652fa6
commit 9247904aa6

View File

@@ -119,18 +119,11 @@ class ClonOS {
include('config.php'); include('config.php');
$this->config=new Config(); $this->config=new Config();
/* check langs start */ /* determine lang */
$larr=array_keys($this->config->languages); if(!array_key_exists($this->language, $this->config->languages)) $this->language='en';
if(!in_array($this->language,$larr)) $this->language='en'; include($this->realpath_public.'/lang/'.$this->language.'.php');
/* check langs end */
$translate_filename=$this->realpath_public.'/lang/'.$this->language.'.php';
$translate_filename_alt=$this->realpath_public.'/lang/en.php';
if(file_exists($translate_filename)) $t_filename=$translate_filename; else $t_filename=$translate_filename_alt;
include($t_filename);
$this->translate_arr=$lang; $this->translate_arr=$lang;
unset($lang); unset($lang);
unset($t_filename);
$this->_client_ip=$_SERVER['REMOTE_ADDR']; $this->_client_ip=$_SERVER['REMOTE_ADDR'];