Sets the server parameters ($_SERVER).

@param  array $server
@return self
186904
public function server(array $server)
    {
        parent::server($server);

        $this->server = $server;

        $this->method = $server['REQUEST_METHOD'];

        $this->target = $server['REQUEST_URI'];

        $http = 'https://';

        if (! isset($server['HTTPS']) || $server['HTTPS'] === 'off')
        {
            $http = 'http://';
        }

        $link = $http . $server['SERVER_NAME'];

        $port = $server['SERVER_PORT'] . $this->target;

        $this->uri = new Uri($link . ':' . $port);

        return $this;
    }
871018
public static function createFromServer(array $server)
    {
        $headerFields = [];
        if (isset($server['PHP_AUTH_USER']) && isset($server['PHP_AUTH_PW'])) {
            $headerFields['Authorization'] = 'Basic ' . base64_encode($server['PHP_AUTH_USER'] . ':' . $server['PHP_AUTH_PW']);
        }

        foreach ($server as $name => $value) {
            if (strpos($name, 'HTTP_') === 0) {
                $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))));
                $headerFields[$name] = $value;
            } elseif ($name == 'REDIRECT_REMOTE_AUTHORIZATION' && !isset($headerFields['Authorization'])) {
                $headerFields['Authorization'] = $value;
            } elseif (in_array($name, ['CONTENT_TYPE', 'CONTENT_LENGTH'])) {
                $name = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $name))));
                $headerFields[$name] = $value;
            }
        }
        return new self($headerFields);
    }
861150
public function init($server = null)
    {
        $server = $server ?: $_SERVER;

        $this->set('args', array());
        if (isset($server['argv'])) {
            // first argument is script name.
            $args = $server['argv'];
            $script = array_shift($args);
            $this->script_name = $script;

            // parse options.
            foreach ($args as $arg) {
                // is long option
                // --foo
                //   => foo=true
                // --foo=bar
                //   => foo=bar
                if (preg_match('/^--(..+)/', $arg, $matches)) {
                    $option = explode('=', $matches[1]);
                    $key = array_shift($option);
                    $value = $option ? join('=', $option) : true;
                    $this->add($key, $value);
                }

                // is short option
                // -abc
                //   => option.a=true, option.b=true, option.c=true
                // -abc=foo
                //   => option.a=true, option.b=true, option.c=foo
                elseif (preg_match('/^-(.+)/', $arg, $matches)) {
                    $option = $matches[1];
                    for ($i = 0; $i < strlen($option); $i++) {
                        $j = $i + 1;
                        $key = $option[$i];
                        if (isset($option[$j]) && $option[$j] === '=') {
                            $value = substr($option, $j + 1);
                            $this->set('option.' . $key, $value);
                            break;
                        } else {
                            $value = true;
                            $this->set('option.' . $key, $value);
                        }
                    }
                }
                // is else to args.
                else {
                    $this->add('args', $arg);
                }
            }
        }
    }
177423
public static function fromArray(array $server)
    {
        $uri = new self('');

        if (isset($server['HTTPS'])) {
            $uri->scheme = $server['HTTPS'] === 'on' ? 'https' : 'http';
        }

        [$host, $port] = Helpers::getHostAndPortFromArray($server);

        $uri->host = \strtolower($host);
        $uri->port = $uri->filterPort($port);

        $path = Helpers::getRequestUri($server);

        $fragment = '';
        if (\strpos($path, '#') !== false) {
            [$path, $fragment] = \explode('#', $path, 2);
        }

        $uri->path = $uri->filterPath(\explode('?', $path, 2)[0]);
        $uri->fragment = $uri->filterFragment($fragment);

        if (isset($server['QUERY_STRING'])) {
            $uri->query = $uri->filterQuery($server['QUERY_STRING']);
        }

        return $uri;
    }
1161105
public function connect(array $servers)
	{
		$memcache = $this->getEngine();

		// For each server in the array, we'll just extract the configuration and add
		// the server to the Memcached connection. Once we have added all of these
		// servers we'll verify the connection is successful and return it back.
		foreach ($servers as $server)
		{
			$memcache->addServer(
				$server['host'], $server['port'], $server['weight']
			);
		}

		if ($memcache->getVersion() === false)
		{
			throw new RuntimeException('Could not establish Memcached connection.');
		}

		// Memcahed has no list keys, we do our own accounting, initialise key index
		if ($memcache->get($this->options['hash'] . '-index') === false)
		{
			$empty = array();
			self::$_db->set($this->oprions['hash'] . '-index', $empty, $this->options['compress'], 0);
		}

		return $memcache;
	}
942595
public function createFromServer(array $server = null){
        $server = $server ?? $_SERVER;

        $scheme     = $this->resolveScheme($server);
        $authority  = $this->resolveAuthority($server, $scheme);
        $path       = $this->resolvePathAndQuery($server);

        return new Uri("{$scheme}://{$authority}{$path}");
    }
1318747
public function setServer(ServerInterface $server): void
    {
        $this->server = $server;
        $this->server->configure($this);
    }
849125
public ProviderConfig<T> setServer(ServerConfig server) {
        if (this.server == null) {
            this.server = new ArrayList<ServerConfig>();
        }
        this.server.add(server);
        return this;
    }
315986
public function setParams($params = null)
    {
        if (isset($params)) {
            $this->params = (array) $params;
        } else {
            $this->params = $this->cli->parseParams($this->server->cliArgs());
        }

        return $this;
    }
889283
public static function prepareServers(array $server)
    {
        // Authorization can only get by apache_request_headers()
        $apacheRequestHeaders = static::$apacheRequestHeaders;

        if (isset($server['HTTP_AUTHORIZATION']) || !is_callable($apacheRequestHeaders)) {
            return $server;
        }

        $apacheRequestHeaders = array_change_key_case(call_user_func($apacheRequestHeaders), CASE_LOWER);

        if (isset($apacheRequestHeaders['authorization'])) {
            $server['HTTP_AUTHORIZATION'] = $apacheRequestHeaders['authorization'];

            return $server;
        }

        return $server;
    }
4079
public function setServerParams($host, $port = 11211, $timeout = NULL, $retry_interval = false, $status = NULL, $failure_callback = NULL)
    {
    }
679635
public function setUp(Server $server, $type)
    {

        if (in_array($type, $this->hasBeenSetUp)) {
            return;
        }
        $this->hasBeenSetUp[] = $type;

        if (isset($this->alias[$type])) {
            foreach ($this->alias[$type] as $target) {
                $this->setUp($server, $target);
            }
            return;
        }
        if (!class_exists($type) && !interface_exists($type)) {
            return;
        }
        $methods = (new ReflectionClass($type))->getMethods();
        $this->functions[$type] = array_map(function (ReflectionMethod $method) {
            return $method->getName();
        }, $methods);

        if (!isset($this->functionWhitelist[$type])) {
            return;
        }

        foreach ($this->functionWhitelist[$type] as $k => $fn) {
            if (in_array($fn, $this->functions[$type]) || (isset($this->customFunctions[$type], $this->customFunctions[$type][$fn]))) {
                continue;
            }
            unset($this->functionWhitelist[$type][$k]);
        }

    }
659324
public function setParams(array $data = [], $reset = false)
    {
        if ($reset) {
            $this->_data = $data;
        }
        foreach ($data as $key => $value) {
            $this->__set($key, $value);
        }
        return $this;
    }
316284
public static function createFromEnvironment(array $server): self
    {
        [$user, $pass] = self::fetchUserInfo($server);
        [$host, $port] = self::fetchHostname($server);
        [$path, $query] = self::fetchRequestUri($server);

        return Uri::createFromComponents([
            'scheme' => self::fetchScheme($server),
            'user' => $user,
            'pass' => $pass,
            'host' => $host,
            'port' => $port,
            'path' => $path,
            'query' => $query,
        ]);
    }
537061
def set_server(self, server_pos, key, value):
        """"""
        if zeroconf_tag and self.zeroconf_enable_tag:
            self.listener.set_server(server_pos, key, value)
788282
private function executeCommand(Server $server)
    {
        $cmd = [
            'createIndexes' => $this->collectionName,
            'indexes' => $this->indexes,
        ];

        if (isset($this->options['maxTimeMS'])) {
            $cmd['maxTimeMS'] = $this->options['maxTimeMS'];
        }

        $server->executeWriteCommand($this->databaseName, new Command($cmd), $this->createOptions());
    }
1174825
public function addServers(array $servers)
    {
        foreach ($servers as $server) {
            $this->addServer(
                $server[0],
                $server[1],
                isset($server[2]) ? $server[2] : null
            );
        }
    }