Amélioration chargement config
This commit is contained in:
parent
6914937f1b
commit
4baebb8aa1
@ -5,9 +5,18 @@ class WsScores
|
||||
protected $login = '';
|
||||
protected $password = '';
|
||||
|
||||
public function __construct($login = '', $password = '') {
|
||||
$config = parse_ini_file(PATH_SITE.'/config/scoresws.ini', true);
|
||||
$this->webservices = $config[ENVIRONNEMENT];
|
||||
public function __construct($login = '', $password = '')
|
||||
{
|
||||
static $file_loaded = false;
|
||||
static $config = array();
|
||||
if (!$file_loaded) {
|
||||
$file = PATH_SITE.'/config/scoresws.ini';
|
||||
if (is_file($file)) {
|
||||
$config = parse_ini_file($file, true);
|
||||
}
|
||||
$file_loaded = true;
|
||||
}
|
||||
$this->webservices = $config[ENVIRONNEMENT];
|
||||
if (empty($login) == false && empty($password) == false) {
|
||||
$this->login = $login;
|
||||
$this->password = $password;
|
||||
|
Loading…
Reference in New Issue
Block a user