public function getActiveHost($asArray = false) { $host = $this->getHostFromRequest(); if ($host === null) { // Get host from config $hosts = $this->getHosts(); $host = $hosts[0]; } return $asArray === true ? explode(':', $host) : $host; }