18declare(strict_types=1);
47 $this->db =
$DIC->database();
68 return count($this->
getServers(static::ACTIVE_SERVER)) ?
true :
false;
76 return count($this->
getServers(static::ALL_SERVER)) ?
true :
false;
86 switch ($server_type) {
87 case static::ALL_SERVER:
90 case static::ACTIVE_SERVER:
93 case static::INACTIVE_SERVER:
97 throw new InvalidArgumentException();
106 $query =
'SELECT server_id FROM ecs_server ' .
110 $this->servers = array();
112 $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.