Setter for servers to be used. Expects an array,  the values are expected
to be formatted like "<host>[:<port>]" or "unix://<path>"

@param array $servers An array of servers to add.
@return void
@throws Exception
@api
183915
protected function setServers(array $servers)
    {
        $this->servers = $servers;
        if (!count($this->servers)) {
            throw new Exception('No servers were given to Memcache', 1213115903);
        }

        $this->memcache = extension_loaded('memcached') ? new \MemCached() : new \Memcache();
        $defaultPort = ini_get('memcache.default_port') ?: 11211;

        foreach ($this->servers as $server) {
            $host = $server;
            $port = 0;

            if (strpos($server, 'tcp://') === 0) {
                $port = $defaultPort;
                $server = substr($server, 6);

                if (strpos($server, ':') !== false) {
                    list($host, $port) = explode(':', $server, 2);
                }
            }

            $this->memcache->addServer($host, $port);
        }
    }
306256
public function setPaths($paths)
    {
        if (!is_array($paths) && !$paths instanceof Traversable) {
            throw new Exception\InvalidArgumentException(sprintf(
                'Invalid argument provided for $paths, expecting either an array or Traversable object, "%s" given',
                is_object($paths) ? get_class($paths) : gettype($paths)
            ));
        }

        $this->clearPaths();
        $this->addPaths($paths);
    }
1091941
public void setDirectoryServers(List<String> servers){
        if(servers == null || servers.size() == 0){
            return;
        }
        directoryServers = new DirectoryServers(servers);
        connection.setDirectoryServers(directoryServers.getNextDirectoryServer());
    }
413435
public function setSources(array $sources)
    {
        $parameters = $this
            ->configuration
            ->getParameters();
        $parameters['sources'] = $sources;

        $this
            ->configuration
            ->setParameters($parameters);
    }
123193
public function setServer($server)
    {
        if (is_a($server,'Cetera\\Server')) {
            $this->_server = $server;
            return $this;
        }
        if (is_int($server)) {
            $this->_server = Server::getById($server);
            return $this;        
        }
    }
783279
public static function addServerToRoles($server, array $roles)
    {
        foreach ($roles as $role) {
            self::$roles[$role][] = $server;
        }

    }
1138045
public function addServersFromFiles($files = [])
    {

        // Since we expect an array let us turn a string (i.e. single file) into an array
        if (!is_array($files)) {
            $files = [$files];
        }

        // Iterate over the file(s) and add them
        foreach ($files as $file) {
            // Check to make sure the file exists and we can read it
            if (!file_exists($file) || !is_readable($file)) {
                continue;
            }

            // See if this file is JSON
            if (($servers = json_decode(file_get_contents($file), true)) === null
                && json_last_error() !== JSON_ERROR_NONE
            ) {
                // Type not supported
                continue;
            }

            // Add this list of servers
            $this->addServers($servers);
        }

        return $this;
    }
1269409
public function configure(array $settings = [])
    {
        if (empty($this->commandName = array_get($settings, 'command_name'))) {
            throw new \Exception("Invalid configuration: missing command name.");
        }

        // Various ways to figure out how to run this thing
        // check settings, then global config, then use the OS to find it
        $this->commandPath = array_get($settings, 'command_path');
        if (empty($this->commandPath)) {
            $this->commandPath = $this->findCommandPath();
            if (empty($this->commandPath = $this->commandName)) {
                throw new \Exception("Failed to find a valid path to command for scripting.");
            }
        }

        $this->arguments = array_get($settings, 'arguments');
        $this->supportsInlineExecution = boolval(array_get($settings, 'supports_inline_execution', false));
        $this->inlineArguments = array_get($settings, 'inline_arguments');
        $this->fileExtension = array_get($settings, 'file_extension');
    }
569664
public function populate(array $vars)
	{
		foreach ($vars as $key => $value)
		{
			if (false === getenv($key))
			{
				$_ENV[$key] = $value;
				$_SERVER[$key] = $value;
				putenv("{$key}={$value}");
			}
		}
	}
649552
public function setCustomHeaders(array $headers)
    {
        foreach ($headers as $k => &$v) {
            if (strpos($v, ':') === false) {
                $v = $k.': '.$v;
            }
        }
        $this->headers = $headers;
    }
909048
protected function setUrls (array $urls)
	{
		foreach ($urls as $key => $value) $this->urls[$key] = $value;
	}
330015
public function setHeaders(array $values)
    {
        foreach ($values as $key => $value) {
            $this->setHeader($key, $value);
        }
    }
589764
public void setServerGroups(java.util.Collection<ServerGroup> serverGroups) {
        if (serverGroups == null) {
            this.serverGroups = null;
            return;
        }

        this.serverGroups = new java.util.ArrayList<ServerGroup>(serverGroups);
    }
259344
public void setServers(java.util.Collection<ListedServer> servers) {
        if (servers == null) {
            this.servers = null;
            return;
        }

        this.servers = new java.util.ArrayList<ListedServer>(servers);
    }
1104572
private function setServer()
    {
        if (isset($_SERVER)) {
            foreach ($_SERVER as $k => $v) {
                $this->log->debug("[ SERVER Params ]" . $k . ": " . $v, []);
                $this->server->$k = $v;
                $this->parameters["server"][$k] = $v;
            }
            unset($_SERVER);
        }
    }
253289
function addServers(array $servers)
    {
        if (isset($servers['host']))
        {
            self::formatServerConfig($servers);
            $this->servers[] = $servers;
        }
        else
        {
            //兼容老的写法
            foreach ($servers as $svr)
            {
                // 127.0.0.1:8001 的写法
                if (is_string($svr))
                {
                    list($config['host'], $config['port']) = explode(':', $svr);
                }
                else
                {
                    $config = $svr;
                }
                self::formatServerConfig($config);
                $this->servers[] = $config;
            }
        }
    }
1311904
public function setAll(array $values) {
		foreach ($values as $name => $value) {
			$this->set($name, $value);
		}
	}