19declare(strict_types=1);
48 $this->db =
$DIC->database();
69 return count($this->
getServers(static::ACTIVE_SERVER)) ?
true :
false;
77 return count($this->
getServers(static::ALL_SERVER)) ?
true :
false;
87 switch ($server_type) {
88 case static::ALL_SERVER:
91 case static::ACTIVE_SERVER:
94 case static::INACTIVE_SERVER:
98 throw new InvalidArgumentException();
107 $query =
'SELECT server_id FROM ecs_server ' .
109 $res = $this->db->query($query);
111 $this->servers = array();
113 $server_id = (
int) $row->server_id;
Collection of ECS settings.
readServers()
Read all servers.
getServers(int $server_type)
Get servers The function must be called with ALL_SERVER, ACTIVE_SERVER or INACTIVE_SERVER.
static ilECSServerSettings $instance
serverExists()
Check if there is any server.
__construct()
Singleton contructor.
static getInstance()
Get singleton instance.
activeServerExists()
Check if there is any active server.
static getInstanceByServerId(int $a_server_id)
Get singleton instance per server.