Piwik\Plugins\UserCountry\LocationProvider\GeoIp\ServerBased::isAvailable PHP Method

isAvailable() public method

There's a special check for the Apache module, but we can't check specifically for anything else.
public isAvailable ( ) : boolean | string
return boolean | string
    public function isAvailable()
    {
        // check if apache module is installed
        if (function_exists('apache_get_modules')) {
            foreach (apache_get_modules() as $name) {
                if (strpos($name, 'geoip') !== false) {
                    return true;
                }
            }
        }
        $available = !empty($_SERVER[self::TEST_SERVER_VAR]) || !empty($_SERVER[self::TEST_SERVER_VAR_ALT]) || !empty($_SERVER[self::TEST_SERVER_VAR_ALT_IPV6]);
        if ($available) {
            return true;
        }
        // if not available return message w/ extra info
        if (!function_exists('apache_get_modules')) {
            return Piwik::translate('General_Note') . ': ' . Piwik::translate('UserCountry_AssumingNonApache');
        }
        $message = "<strong>" . Piwik::translate('General_Note') . ':&nbsp;' . Piwik::translate('UserCountry_FoundApacheModules') . "</strong>:<br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n";
        foreach (apache_get_modules() as $name) {
            $message .= "<li>{$name}</li>\n";
        }
        $message .= "</ul>";
        return $message;
    }