Initialize Connection Details
@param array $options Configuration options
@return Client This instance
@throws ConfigurationException If port is invalid
550878
public function configure(array $options = array())
    {
        if (isset($options['host'])) {
            $this->host = $options['host'];
        }
        if (isset($options['port'])) {
            if (!is_numeric($options['port']) || is_float($options['port']) || $options['port'] < 0 || $options['port'] > 65535) {
                throw new ConfigurationException($this, 'Port is out of range');
            }
            $this->port = $options['port'];
        }

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

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

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

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

        return $this;
    }
1193037
public function create(array $options = [])
    {
        $data = $this->creationSerialize();

        $this->security->getKuzzle()->query(
            $this->security->buildQueryArgs('createUser'),
            $data,
            $options
        );

        return $this;
    }
709763
public static function create(string $host, array $options = []) : Socket
    {
        return (new self(null, $options))->connect($host);
    }
1228338
protected function initializeOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $method = 'set' . ucfirst($key);
            if (method_exists($this, $method)) {
                call_user_func(array($this, $method), $value);
            }
        }
    }
123350
public function setOptions(array $options): Options
    {
        foreach ($options as $key => $option) {
            $this->options[$key] = $option;
        }

        return $this;
    }
717036
public static function GetConnection ($options) {
		$connection_name = static::AdjustConnectionName($options);

		if (!isset(static::$_connectionList[$connection_name])) {
			static::_Connect($options);
		}
		return static::$_connectionList[$connection_name];
	}
476394
public static function getConnection(array $options): Client
    {
        if (self::$connection === null) {
            $builder = new ClientBuilder([
                'cw.endpoint_uri' => $options['environment'] == 0 ? CodesWholesale::SANDBOX_ENDPOINT : CodesWholesale::LIVE_ENDPOINT,
                'cw.client_id' => $options['environment'] == 0 ? self::SANDBOX_CLIENT_ID : $options['client_id'],
                'cw.client_secret' => $options['environment'] == 0 ? self::SANDBOX_CLIENT_SECRET : $options['client_secret'],
                'cw.token_storage' => isset($options['db']) && $options['db'] instanceof \PDO ? new TokenDatabaseStorage($options['db'], $options['prefix']) : new TokenSessionStorage(),
                'cw.client.headers' => [
                    'User-Agent' => $options['client_headers'],
                ],
                'cw.signature' => isset($options['signature']) ? $options['signature'] : self::SANDBOX_SIGNATURE
            ]);

            self::$connection = $builder->build();
       }
        
        return self::$connection;
    }
863602
private function getClient() {
        $login = $this->getParam('login');
        $password = $this->getParam('password');
        $sender = $this->getParam('sender');

        if (empty($sender) || (empty($login) || empty($password))) {
            throw new ConfigurationException(__CLASS__ . ' is not configured properly. Please set "sender" and "login" and "password" parameters properly.');
        }

        return Sender::create($login, md5($password), $sender);
    }
1111498
public function setOptions(array $options)
    {
        foreach ($options as $option => $value) {
            $this->setOption($option, $value);
        }

        return $this;
    }
1246067
private function getClient() {
        $login = $this->getParam('login');
        $password = $this->getParam('password');

        if (empty($login) || empty($password)) {
            throw new ConfigurationException(__CLASS__ . ' is not configured properly. Please set "login" and "password" parameters properly.');
        }

        return new SerwerSMS($login, $password);
    }
1168720
public function setOptions($options = [])
    {
        if (!is_array($options)) {
            $options = [];
        }

        $this->options = array_merge($this->getDefaults(), $options);
        return $this;
    }
6784
public function config(array $options)
    {
        $this->options = $options;
    
        $this->initializeOptions($options);
    
        if ($this->getSession()->debug == true) {
            $this->setDebug(true);
        }
    }
46251
protected static function _Connect ($options) {
		$connection_name = static::AdjustConnectionName($options);

		if (!isset(static::$_dsnList[$connection_name])) {
			throw CoreException::RaiseSystemError('未定義のファイル設定を用いて接続しようとしています。connection_name:%s', [$connection_name]);
		}

		$dsn = static::$_dsnList[$connection_name];
		$driver_class_name = sprintf('%s\drivers\%s%s', __NAMESPACE__, Strings::ToUpperCamelCase($dsn['driver']), static::DRIVER_CLASS_NAME_SAFIX);
		static::$_connectionList[$connection_name] = $driver_class_name::Connect($dsn);
	}
316462
final protected function connect($con, array $options = array())
	{
		if (is_null($con)) {
			$con = self::DEFAULT_CON;
		}
		if (is_string($con)) {
			if (! pathinfo($con, PATHINFO_EXTENSION)) {
				$con .= '.' . self::DEFAULT_EXTENSION;
			}
			$con = $this->parse($con);
		} elseif (is_array($con)) {
			$con = (object)$con;
		}
		if (!is_object($con) or !(isset($con->user) and isset($con->password))) {
			throw new \DomainException('PDO requires at least a user and password');
		}
		$this->user = $con->user;
		$this->password = $con->password;
		$this->type = (isset($con->type)) ? $con->type : self::DEFAULT_TYPE;
		$this->database = (isset($con->database)) ? $con->database : $this->user;
		$this->port = (isset($con->port) and $con->port !== self::DEFAULT_PORT) ? $con->port : null;
		$this->host = (isset($con->host) and $con->host !== self::DEFAULT_HOST) ? $con->host : null;
		$this->dsn = "{$this->type}:dbname={$this->database}";

		if (
			is_string($this->host) and (
				filter_var($this->host, FILTER_VALIDATE_IP)
				or filter_var("http://{$this->host}", FILTER_VALIDATE_URL)
			)
		) {
			$this->dsn .= ";host={$this->host}";
		}

		if (is_int($this->port)) {
			$this->dsn .= ";port={$this->port}";
		}

		try {
			parent::__construct(
				$this->dsn,
				$this->user,
				$this->password,
				$options
			);

			$this->connected = true;
		} catch(\PDOException $e) {
			$this->connected = false;
			//echo $e . PHP_EOL;
		}
	}
88270
public function connect($options = [])
    {
        if ($options instanceof PDO) {
            $this->connection = $options;
            return $this;
        }
        
        if (!is_array($options)) {
            $options = array();
        }

        $this->connection = new PDO('sqlite:'.$this->path);
        $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        
        return $this;
    }
897387
public function setOptions(array $options = array())
    {
        if (array_key_exists('messages', $options)) {
            $this->setMessages($options['messages']);
        }

        if (array_key_exists('hostname', $options)) {
            if (array_key_exists('allow', $options)) {
                $this->setHostnameValidator($options['hostname'], $options['allow']);
            } else {
                $this->setHostnameValidator($options['hostname']);
            }
        } elseif ($this->_options['hostname'] == null) {
            $this->setHostnameValidator();
        }

        if (array_key_exists('mx', $options)) {
            $this->setValidateMx($options['mx']);
        }

        if (array_key_exists('deep', $options)) {
            $this->setDeepMxCheck($options['deep']);
        }

        if (array_key_exists('domain', $options)) {
            $this->setDomainCheck($options['domain']);
        }

        return $this;
    }
365814
private function setRequestOptions(array $options)
    {
        $config = $this->getGuzzleClient()->getConfig();
        $config->set(Client::REQUEST_OPTIONS, $options);

        $this->getGuzzleClient()->setConfig($config);
    }