/** * Build the Server Matrix * * @return array */ public function build() { $self = ['alias' => getServerAlias(), 'url' => getServerUrl(), 'type' => getServerType()]; $servers = []; if (hasSlaves()) { $servers['servers'] = []; foreach (getSlaves() as $slave) { $servers['servers'][] = $this->getSlaveInformations($slave); } } return array_merge($self, $servers); }
/** * Collect and return serverinfos as json * * @return array */ public function info() { return ['alias' => getServerAlias(), 'url' => getServerUrl(), 'type' => getServerType(), 'slaves' => getSlaves(), "whitelisted_ips" => getWhitelistedIps()]; }