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

getInfo() public method

array( 'id' => 'geoip_serverbased', 'title' => '...', 'description' => '...' );
public getInfo ( ) : array
return array
    public function getInfo()
    {
        if (function_exists('apache_note')) {
            $serverDesc = 'Apache';
        } else {
            $serverDesc = Piwik::translate('UserCountry_HttpServerModule');
        }
        $title = sprintf(self::TITLE, $serverDesc);
        $desc = Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased1', array('<strong>', '</strong>')) . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBasedAnonWarn') . '<br/><br/>' . Piwik::translate('UserCountry_GeoIpLocationProviderDesc_ServerBased2', array('<strong>', '</strong>', '<strong>', '</strong>'));
        $installDocs = '<a rel="noreferrer"  target="_blank" href="http://piwik.org/faq/how-to/#faq_165">' . Piwik::translate('UserCountry_HowToInstallApacheModule') . '</a><br/>' . '<a rel="noreferrer"  target="_blank" href="http://piwik.org/faq/how-to/#faq_166">' . Piwik::translate('UserCountry_HowToInstallNginxModule') . '</a>';
        $geoipServerVars = array();
        foreach ($_SERVER as $key => $value) {
            if (strpos($key, 'GEOIP') === 0) {
                $geoipServerVars[] = $key;
            }
        }
        if (empty($geoipServerVars)) {
            $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPNoServerVars', '$_SERVER') . '</strong>';
        } else {
            $extraMessage = '<strong>' . Piwik::translate('UserCountry_GeoIPServerVarsFound', '$_SERVER') . ":</strong><br/><br/>\n<ul style=\"list-style:disc;margin-left:24px\">\n";
            foreach ($geoipServerVars as $key) {
                $extraMessage .= '<li>' . $key . "</li>\n";
            }
            $extraMessage .= '</ul>';
        }
        return array('id' => self::ID, 'title' => $title, 'description' => $desc, 'order' => 4, 'install_docs' => $installDocs, 'extra_message' => $extraMessage);
    }