Clickalicious\PhpMemAdmin\App::getActiveHost PHP Method

getActiveHost() public method

Returns currently active host. If no host is active, the first one found in list of servers is the active one.
Author: Benjamin Carl ([email protected])
public getActiveHost ( boolean $asArray = false ) : string
$asArray boolean TRUE to return the host as prepared array, otherwise FALSE to return as string (default).
return string The active host name or ip
    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;
    }