mirror of
https://github.com/optim-enterprises-bv/control-pane.git
synced 2025-11-02 02:48:02 +00:00
* Simplify lang include
I would skip the unset and leave it to the GC
This commit is contained in:
@@ -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'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user