Tries to identify the post powerful/weakest server group on the virtual server and returns
the ID.

@param  integer $mode
@return Servergroup
965129
public function serverGroupIdentify($mode = Teamspeak::GROUP_IDENTIFIY_STRONGEST)
    {
        $profiles = $this->serverGroupGetProfiles();

        $best_guess_profile = ($mode == Teamspeak::GROUP_IDENTIFIY_STRONGEST) ? array_shift($profiles) : array_pop(
            $profiles
        );

        return $this->serverGroupGetById($best_guess_profile["__sgid"]);
    }
337737
public static function getKeyGroup($blogId = null)
    {
        $keyGroup = self::$keyGroup;

        if (!function_exists('is_multisite') || !is_multisite()) {
            return $keyGroup;
        }

        if (is_null($blogId)) {
            $blogId = get_current_blog_id();
        }

        $keyGroup .= '-' . $blogId;
        return $keyGroup;
    }
844818
public function withSSL(int $mode = self::SSL_AUTO): self
    {
        $this->ssl = $mode;

        return $this;
    }
114339
public function getServerName(string $serverId)
    {
        if (!$this->hasServerConfiguration($serverId)) {
            return null;
        }

        return $this->configuration['connections'][$serverId]['name'];
    }
1036699
protected function emitValidRequestSources($mode)
    {
        $requestSources = [
            'ENVIRONMENT' => self::NATIVE,
            'SERVER'      => self::NATIVE,
        ];

        switch ($mode) {
            case Doozr_Kernel::RUNTIME_ENVIRONMENT_CLI:
                $requestSources = array_merge(
                    $requestSources,
                    [
                        'CLI' => self::NATIVE,
                    ]
                );
                break;

            case Doozr_Kernel::RUNTIME_ENVIRONMENT_WEB:
            case Doozr_Kernel::RUNTIME_ENVIRONMENT_HTTPD:
            default:
                $requestSources = array_merge(
                    $requestSources,
                    [
                        'GET'     => self::NATIVE,
                        'POST'    => self::NATIVE,
                        'HEAD'    => self::EMULATED,
                        'OPTIONS' => self::EMULATED,
                        'PUT'     => self::EMULATED,
                        'DELETE'  => self::EMULATED,
                        'TRACE'   => self::EMULATED,
                        'CONNECT' => self::EMULATED,
                        'COOKIE'  => self::NATIVE,
                        'REQUEST' => self::NATIVE,
                        'SESSION' => self::NATIVE,
                        'FILES'   => self::NATIVE,
                    ]
                );
                break;
        }

        return $requestSources;
    }
1004826
public function identify(string $webserviceId)
    {
        //==============================================================================
        // Use Sf Event to Identify Server
        /** @var IdentifyServerEvent $event */
        $event = $this->getEventDispatcher()->dispatch(
            IdentifyServerEvent::NAME,
            new IdentifyServerEvent($this, $webserviceId)
        );
        //==============================================================================
        // If Connection Was Rejected
        if ($event->isRejected()) {
            return null;
        }
        //==============================================================================
        // Ensure Identify Server was Ok
        return $event->isIdentified();
    }
176234
public function getGroupIDForCapability($capability)
    {
        if (!isset($capability) || !array_key_exists($capability, $this->groupIDCapabilitiesMap)) {
            throw new \InvalidArgumentException('an invalid capability was specified.');
        }

        return $this->groupIDCapabilitiesMap[$capability];
    }
378270
public function getHtmlHeadEntrySet($mode = 'min')
    {
        $set = new SwatHtmlHeadEntrySet();
        if (isset($this->html_head_entry_set[$mode])) {
            foreach ($this->dependencies as $component) {
                $set->addEntrySet($component->getHtmlHeadEntrySet($mode));
            }
            $set->addEntrySet($this->html_head_entry_set[$mode]);
        }

        return $set;
    }
314304
public function setDefaultMode(string $mode = null) : RauthInterface
    {
        if (!in_array($mode, self::MODES)) {
            throw new \InvalidArgumentException(
                'Mode ' . $mode . ' not accepted!'
            );
        }
        $this->defaultMode = $mode;

        return $this;
    }
772960
public function matchMode($mode)
    {
        if (!self::validMatchMode($mode)) {
            throw new WURFL_WURFLException('Invalid Match Mode: '.$mode);
        }
        $this->matchMode = $mode;
        return $this;
    }
701360
public function begin($mode = IExpressionGroup::MODE_AND)
    {
        $parentGroup = $this->currentExpressionGroup;

        $group = $this->queryBuilderFactory->createExpressionGroup($mode, $parentGroup);
        if ($parentGroup) {
            $parentGroup->addGroup($group);
        }

        $this->currentExpressionGroup = $group;

        return $this;
    }
718979
public function getWebserviceId(string $serverId)
    {
        if (!$this->hasServerConfiguration($serverId)) {
            return null;
        }

        return $this->configuration['connections'][$serverId]['id'];
    }
579918
public function isActive($mode = null)
    {
        if ($mode !== null && isset($_GET[$this->name])) {
            return $_GET[$this->name] == $mode;
        }

        return isset($_GET[$this->name]) ? $_GET[$this->name] : false;
    }
17412
public function switchMode( $mode ) {
		$this->mode = $mode;
		$this->handler = $this->dispatchTable[$mode];
		return $this->handler;
	}
1109955
public function getServerHost(string $serverId)
    {
        if (!$this->hasServerConfiguration($serverId)) {
            return null;
        }

        return $this->configuration['connections'][$serverId]['server_host'];
    }
693248
public function switchAndSave( $mode ) {
		$this->originalMode = $this->mode;
		$this->mode = $mode;
		$this->handler = $this->dispatchTable[$mode];
		return $this->handler;
	}
1277521
public function getGroupId($current = true)
    {
        if ($current && $this->_hasVar('current_user_group')) {
            return $this->_getVar('current_user_group');
        }
        return $this->_getVar('user_group');
    }