private function detectPreferences()
    {
        // assume empty result
        $detectedPreferences = false;

        // prevent access to HEADER and IP in CLI does not make sense
        if (Doozr_Kernel::RUNTIME_ENVIRONMENT_CLI !== self::$runtimeEnvironment) {

            // try to detect locale by user-agents header
            $detectedPreferences = $this->detectByRequestHeader();

            // FALLBACK: try to detect by user's ip/dns-hostname
            if (!$detectedPreferences) {
                // FALLBACK: try to detect by user's ip/dns-hostname
                $detectedPreferences = $this->detectByUserIp();
            }
        }

        // and finally store the detected results
        return $detectedPreferences;
    }
private function detectPreferences()
    {
        // assume empty result
        $detectedPreferences = false;

        // prevent access to HEADER and IP in CLI does not make sense
        if (Doozr_Kernel::RUNTIME_ENVIRONMENT_CLI !== self::$runtimeEnvironment) {

            // try to detect locale by user-agents header
            $detectedPreferences = $this->detectByRequestHeader();

            // FALLBACK: try to detect by user's ip/dns-hostname
            if (!$detectedPreferences) {
                // FALLBACK: try to detect by user's ip/dns-hostname
                $detectedPreferences = $this->detectByUserIp();
            }
        }

        // and finally store the detected results
        return $detectedPreferences;
    }
private function detectPreferences ( ) { // assume empty result $ detectedPreferences = false ; // prevent access to HEADER and IP in CLI does not make sense if ( Doozr_Kernel :: RUNTIME_ENVIRONMENT_CLI !== self :: $ runtimeEnvironment ) { // try to detect locale by user-agents header $ detectedPreferences = $ this -> detectByRequestHeader ( ) ; // FALLBACK: try to detect by user's ip/dns-hostname if ( ! $ detectedPreferences ) { // FALLBACK: try to detect by user's ip/dns-hostname $ detectedPreferences = $ this -> detectByUserIp ( ) ; } } // and finally store the detected results return $ detectedPreferences ; }
This method is intend to control the detection of the users locale preferences.

@author Benjamin Carl <opensource@clickalicious.de>

@return array An array containing the preferred "locale" + "weight", "language" and "country"
This method is intend to control the detection of the users locale preferences .