Connects to the SOAP server using the WSDL in the configuration

@param array $options The options
@return bool True on success, false on failure
331453
public function connect(array $options = [])
    {
        $config = $this->_parseConfig($options);
        try {
            $this->client = new SoapClient($this->getConfig('wsdl'), $config);
        } catch (SoapFault $fault) {
            $this->handleError($fault->faultstring);
        }

        if ($this->client) {
            $this->connected = true;
        }

        return $this->connected;
    }
969434
public function deleteBucket(array $options)
    {
        if (!isset($options['BucketId']) && isset($options['BucketName'])) {
            $options['BucketId'] = $this->getBucketIdFromName($options['BucketName']);
        }

        try {
            $this->generateAuthenticatedClient([
                'accountId' => $this->accountId,
                'bucketId'  => $options['BucketId'],
            ])->request('POST', $this->apiUrl.'/b2_delete_bucket');
        } catch (\Exception $e) {
            return false;
        }

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

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

        return $this;
    }
1198560
public function exists(array $options = [])
    {
        try {
            $this->connection->getObject($this->identity + $options + ['fields' => 'name']);
        } catch (NotFoundException $ex) {
            return false;
        }

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

        $this->getGuzzleClient()->setConfig($config);
    }
1228319
public function createSwooleServer(array $options = array())
    {
        if (array() === $options) {
            $options = array(
                'daemonize' => false,
                'worker_num' => 1,
            );
        }

        return new SwooleServer(
            new SwooleMessageTransformer($this->getPsr7Factory()),
            new SwooleServerOptions($options)
        );
    }
1111498
public function setOptions(array $options)
    {
        foreach ($options as $option => $value) {
            $this->setOption($option, $value);
        }

        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;
    }
717008
public function initSoapClient($_wsdlOptions)
    {
        $wsdlOptions = array();
        $defaultWsdlOptions = self::getDefaultWsdlOptions();
        foreach($defaultWsdlOptions as $optioName=>$optionValue)
        {
            if(array_key_exists($optioName,$_wsdlOptions) && !is_null($_wsdlOptions[$optioName])) {
                $wsdlOptions[str_replace('wsdl_', '', $optioName)] = $_wsdlOptions[$optioName];
            } elseif(!empty($optionValue)) {
                $wsdlOptions[str_replace('wsdl_', '', $optioName)] = $optionValue;
            }
        }

        if(array_key_exists(str_replace('wsdl_','',self::WSDL_URL),$wsdlOptions))
        {
            $wsdlUrl = $wsdlOptions[str_replace('wsdl_','',self::WSDL_URL)];
            unset($wsdlOptions[str_replace('wsdl_','',self::WSDL_URL)]);
            $soapClientClassName = self::getSoapClientClassName();

            $connection_timeout = 0;
            $retries = 1;
            $read_timeout = null;
            if(isset($_wsdlOptions['connection_options']) && is_array($_wsdlOptions['connection_options'])) {
                extract($_wsdlOptions['connection_options']);
                unset($_wsdlOptions['connection_options']);
            }

            @ini_set("soap.wsdl_cache_enabled", 0);
            if($soapClientClassName == '\Omniship\Rapido\Helper\SoapClient') {
                $soapClient = new $soapClientClassName($wsdlUrl,$wsdlOptions, $connection_timeout, $retries, $read_timeout);
            } else {
                $soapClient = new $soapClientClassName($wsdlUrl,$wsdlOptions);
            }

            self::setSoapClient($soapClient);
        }
    }
630857
protected function setOptions(array $options)
	{
		// Set name
		if (isset($options['name']))
		{
			session_name(md5($options['name']));
		}

		// Set id
		if (isset($options['id']))
		{
			session_id($options['id']);
		}

		// Set expire time
		if (isset($options['expire']))
		{
			$this->setExpire($options['expire']);
		}

		// Get security options
		if (isset($options['security']))
		{
			$this->security = explode(',', $options['security']);
		}

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

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

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

		// Sync the session maxlifetime
		if (!headers_sent())
		{
			ini_set('session.gc_maxlifetime', $this->getExpire());
		}

		return true;
	}
301549
private function resolveOptions(array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configure($resolver);

        return $resolver->resolve($options);
    }
490784
public function setOptions(array $options)
    {
        $this->validateOptions($options, $this->type);

        $this->options = $options;

        return $this;
    }
229803
public function setOptions(array $options)
    {
        foreach ($options as $key => $value) {
            $this->options[$key] = $value;
            $value && $this->object->$key = $value;
        }

        return $this;
    }
450658
public static function invokeSoap($wsdlURL, $method,
                                      array $params = array(),
                                      array $options = array())
    {
        try {
            $soapClient = new \SoapClient($wsdlURL, $options);
            $result     = $soapClient->$method($params);
        } catch (\SoapFault $ex) {
            $result = false;
        }
        return $result;
    }
1206564
public function getAMQPConnection(array $options)
    {
        if (!class_exists(AMQPStreamConnection::class)) {
            throw new \DomainException('Please install php-amqplib/php-amqplib first.');
        }

        $defaultOptions = [
            'host' => 'localhost',
            'port' => 5672,
            'user' => 'guest',
            'password' => 'guest',
        ];

        $options = array_merge($defaultOptions, $options);

        return new AMQPStreamConnection(
            $options['host'],
            $options['port'],
            $options['user'],
            $options['password']
        );
    }
90763
public function connectOauth1($options)
    {
        $token = false;

        // source oauth provider
        $oauthProvider = $this->getProvider();

        // denied
        if(\Craft\craft()->request->getParam('denied'))
        {
            throw new \Exception("An error occured: ".\Craft\craft()->request->getParam('denied'));
        }

        $user = \Craft\craft()->request->getParam('user');
        $oauth_token = \Craft\craft()->request->getParam('oauth_token');
        $oauth_verifier = \Craft\craft()->request->getParam('oauth_verifier');
        $denied = \Craft\craft()->request->getParam('denied');

        if ($oauth_token && $oauth_verifier)
        {
            $temporaryCredentials = unserialize(\Craft\craft()->httpSession->get('temporary_credentials'));

            $token = $oauthProvider->getTokenCredentials($temporaryCredentials, $oauth_token, $oauth_verifier);

            \Craft\craft()->httpSession->add('token_credentials', serialize($token));

            OauthPlugin::log('OAuth 1.0 Connect - Get token credentials'."\r\n".print_r([
                'temporaryCredentials' => $temporaryCredentials,
                'oauth_token' => $oauth_token,
                'oauth_verifier' => $oauth_verifier,
                'token' => $token,
            ], true), LogLevel::Info);
        }
        elseif ($denied)
        {
        	$errorMsg = "Client access denied by user";

            OauthPlugin::log('OAuth 1.0 Connect - '.$errorMsg, LogLevel::Info);

            throw new \Exception($errorMsg);
        }
        else
        {
            $temporaryCredentials = $oauthProvider->getTemporaryCredentials();

            \Craft\craft()->httpSession->add('temporary_credentials', serialize($temporaryCredentials));

            $authorizationUrl = $oauthProvider->getAuthorizationUrl($temporaryCredentials);
            \Craft\craft()->request->redirect($authorizationUrl);


	        OauthPlugin::log('OAuth 1.0 Connect - Redirect to the authorization URL'."\r\n".print_r([
		        'temporaryCredentials' => $temporaryCredentials,
                'authorizationUrl' => $authorizationUrl,
		    ], true), LogLevel::Info);
        }

        return $token;
    }
929924
public function getClient(array $options = [])
    {
        if ($this->client) {
            return $this->client;
        }

        $this->client = new Client(
            [
                'base_url' => $this->baseUrl,
                'defaults' => [
                    'headers' => [
                        'Authorization' => 'Bearer ' . $this->accessToken,
                    ]
                ]
            ]
        );

        return $this->client;
    }