Load the connection adapter

@return Zend_Http_Client_Adapter_Interface $adapter
192205
public function getAdapter()
    {
        if (null === $this->adapter) {
            $this->setAdapter($this->config['adapter']);
        }

        return $this->adapter;
    }
1084986
public function getHttpAdapter()
    {
        if (null === $this->httpAdapter) {
            $this->httpAdapter = new Http\Client\Adapter\Curl();
            $this->httpAdapter->setOptions(array(
                'curloptions' => array(
                    CURLOPT_SSL_VERIFYPEER => false,
                ),
            ));
        }

        return $this->httpAdapter;
    }
149969
protected function loadClient(): void
    {
        if (self::$client === null) {
            $options = $this->options;

            if (!isset($options['servlet_address'])) {
                throw new Exception\InvalidArgumentException(__METHOD__.' Missing required parameter servlet_address');
            }

            $connection = static::parseServletUrl($options['servlet_address']);

            $params = new ArrayObject([
                Client::PARAM_JAVA_HOSTS => $connection['servlet_host'],
                Client::PARAM_JAVA_SERVLET => $connection['servlet_uri'],
                Client::PARAM_JAVA_AUTH_USER => $connection['auth_user'],
                Client::PARAM_JAVA_AUTH_PASSWORD => $connection['auth_password'],
                Client::PARAM_JAVA_DISABLE_AUTOLOAD => $options['java_disable_autoload'],
                Client::PARAM_JAVA_PREFER_VALUES => $options['java_prefer_values'],
                Client::PARAM_JAVA_SEND_SIZE => $options['java_send_size'],
                Client::PARAM_JAVA_RECV_SIZE => $options['java_recv_size'],
                Client::PARAM_JAVA_LOG_LEVEL => $options['java_log_level'],
                Client::PARAM_XML_PARSER_FORCE_SIMPLE_PARSER => $options['force_simple_xml_parser'],
                Client::PARAM_USE_PERSISTENT_CONNECTION => $options['use_persistent_connection']
            ]);

            self::$client = new Client($params, $this->logger);

            // Added in order to work with custom exceptions
            self::getClient()->throwExceptionProxyFactory = new Proxy\DefaultThrowExceptionProxyFactory(self::$client, $this->logger);

            $this->bootstrap();
        }
    }
1144111
public function getAuthenticationAdapter()
    {
        if (null === $this->authenticationAdapter) {
            $authenticationAdapter = $this->getAuthenticationService()->getAdapter();
            $this->setAuthenticationAdapter($authenticationAdapter);
        }

        return $this->authenticationAdapter;
    }
476830
protected function getConnection()
    {
        $hosts = $this->getHostList();

        while ($host = array_shift($hosts)) {
            try {
                return $this->connectSocket($host);
            } catch (ConnectionException $connectionException) {
                if (empty($hosts)) {
                    throw new ConnectionException("Could not connect to a broker", [], $connectionException);
                }
            }
        }
    }
1126877
public function openConnection()
    {
        if (null == $this->httpClient) {
            return false;
        }

        $configuration = array_merge(array(
            'authUrl' => '',
            'password' => '',
            'queryUrl' => '',
            'username' => ''
        ), $this->configuration);

        // authenticate only if an authUrl was given.
        if ($this->RdfHelpers->simpleCheckURI($configuration['authUrl'])) {
            $this->authenticateOnServer(
                $configuration['authUrl'],
                $configuration['username'],
                $configuration['password']
            );
        }

        // check query URL
        if (false === $this->RdfHelpers->simpleCheckURI($configuration['queryUrl'])) {
            throw new \Exception('Parameter queryUrl is not an URI or empty: '. $configuration['queryUrl']);
        }
    }
128221
public static function getRequestAdapter()
    {
        if (!self::$_requestAdapter) {
            if (class_exists('Zend_Controller_Front', false)) {
                self::$_requestAdapter = new CheddarGetter_Http_ZendAdapter();
            } else {
                self::$_requestAdapter = new CheddarGetter_Http_NativeAdapter();
            }
        }

        return self::$_requestAdapter;
    }
222438
protected function getAdapter()
    {
        $type = strtolower($this->options['type']);
        if (!$this->adapter) {
            if ($this->options['class']) {
                $adapterClass = $this->options['class'];
            } else {
                $adapterClass = '\\Wslim\\Security\\Crypt\\' . ucfirst($type) . 'Adapter';
            }
            
            if (!class_exists($adapterClass)) {
                throw new Exception('crypt type is not exists: ' . $type . ' .');
            }
            $this->adapter = new $adapterClass();
        }
        return $this->adapter;
    }
592841
private function getLoader(): LoaderInterface
    {
        if (null !== $this->loader) {
            return $this->loader;
        }

        if (null !== $this->localFile) {
            $this->loader = new Local($this->localFile);

            return $this->loader;
        }

        if (extension_loaded('curl')) {
            $this->loader = new Curl($this);

            return $this->loader;
        }

        $streamHelper = new StreamCreator($this);

        if (ini_get('allow_url_fopen')) {
            $this->loader = new FopenLoader($this, $streamHelper);

            return $this->loader;
        }

        $this->loader = new SocketLoader($this, $streamHelper);

        return $this->loader;
    }
1093146
protected function _load()
    {
        if (empty($this->_plugins)) {
            $this->_plugins = AnService::get('repos:settings.plugin')
                              ->getQuery()
                              ->where('enabled', '=', 1)
                              ->toEntityset();
        }

        return $this->_plugins;
    }
460742
public static function load()
    {
        if (!extension_loaded('opencensus')) {
            trigger_error('opencensus extension required to load grpc integrations.', E_USER_WARNING);
            return;
        }

        // protected function _simpleRequest($method, $argument, $deserialize, array $metadata = [],
        //                                   array $options = [])
        opencensus_trace_method(BaseStub::class, '_simpleRequest', function ($stub, $method) {
            return [
                'name' => 'grpc/simpleRequest',
                'attributes' => [
                    'host' => $stub->getTarget(),
                    'uri' => $method
                ],
                'kind' => Span::KIND_CLIENT
            ];
        });

        // protected function _clientStreamRequest($method, $argument, $deserialize, array $metadata = [],
        //                                         array $options = [])
        opencensus_trace_method(BaseStub::class, '_clientStreamRequest', function ($stub, $method) {
            return [
                'name' => 'grpc/clientStreamRequest',
                'attributes' => [
                    'host' => $stub->getTarget(),
                    'uri' => $method
                ],
                'kind' => Span::KIND_CLIENT
            ];
        });

        // protected function _serverStreamRequest($method, $argument, $deserialize, array $metadata = [],
        //                                         array $options = [])
        opencensus_trace_method(BaseStub::class, '_serverStreamRequest', function ($stub, $method) {
            return [
                'name' => 'grpc/serverStreamRequest',
                'attributes' => [
                    'host' => $stub->getTarget(),
                    'uri' => $method
                ],
                'kind' => Span::KIND_CLIENT
            ];
        });

        // protected function _bidiRequest($method, $deserialize, array $metadata = [], array $options = [])
        opencensus_trace_method(BaseStub::class, '_bidiRequest', function ($stub, $method) {
            return [
                'name' => 'grpc/bidiRequest',
                'attributes' => [
                    'host' => $stub->getTarget(),
                    'uri' => $method
                ],
                'kind' => Span::KIND_CLIENT
            ];
        });
    }
401141
public function connect()
    {
        $this->connect = ldap_connect($this->hostname, $this->port);

        if (!$this->connect) {
            throw new ConnectionException($this);
        }

        // Set Ldap Version to 3
        ldap_set_option($this->connect, LDAP_OPT_PROTOCOL_VERSION, 3);

        if (!is_null($this->username) && !is_null($this->password)) {
            if (!@ldap_bind($this->connect, $this->username, $this->password)) {
                throw new BadIdentificationException($this);
            }
        }

        return new Client($this->connect);
    }
1335895
public function connect()
    {
        if ($this->connection != null) {
            $this->disconnect();
        }

        if ($this->config['persistent'] == true) {
            $tmp = null;
            $this->connection = @pfsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
        } else {
            $this->connection = fsockopen($this->config['host'], $this->config['port'], $errNum, $errStr, $this->config['timeout']);
        }

        if (!empty($errNum) || !empty($errStr)) {
            $this->error($errStr, $errNum);
        }

        $this->connected = is_resource($this->connection);

        return $this->connected;
    }
358780
protected function getDbAdapter()
    {
        if ( null === $this->dbAdapter )
        {
            $this->dbAdapter = $this->getServiceManager()
                                    ->get( 'Zend\Db\Adapter\Adapter' );
        }

        return $this->dbAdapter;
    }
743986
public function connect()
    {
        $streamContext = stream_context_create(array(
            $this->getTransport() => $this->getContextOptions()
        ));

        $streamResource = stream_socket_client(
            $this->getAddress(),
            $errorCode,
            $errorMessage,
            $this->getSocketTimeout(),
            $this->getConnectionFlags(),
            $streamContext
        );

        if (!$streamResource) {
            throw new \RuntimeException(sprintf(
                'Unable to connect on socket. Error [%d]: %s',
                $errorCode,
                $errorMessage
            ));
        }

        stream_set_blocking($streamResource, $this->isBlockingMode());

        $this->setStreamResource($streamResource);

        return $this;
    }
1116120
public function getAdapter()
    {
        $this->count++;
        if (is_null($this->adapter)) {
            $fss = $this->getServiceManager()->get(FileSystemService::SERVICE_ID);
            $this->adapter = $fss->getFileSystem($this->getOption('inner'))->getAdapter();
        }
        return $this->adapter;
    }
908028
protected function _connect()
	{
		$sURL = $this->_aServiceURLs[$this->_nEnvironment];
		unset($aURLs);

		$this->_log("INFO: Trying {$sURL}...");

		/**
		 * @see http://php.net/manual/en/context.ssl.php
		 */
		$streamContext = stream_context_create(array('ssl' => array(
			'verify_peer' => isset($this->_sRootCertificationAuthorityFile),
			'cafile' => $this->_sRootCertificationAuthorityFile,
			'local_cert' => $this->_sProviderCertificateFile
		)));

		if (!empty($this->_sProviderCertificatePassphrase)) {
			stream_context_set_option($streamContext, 'ssl',
				'passphrase', $this->_sProviderCertificatePassphrase);
		}

		$this->_hSocket = @stream_socket_client($sURL, $nError, $sError,
			$this->_nConnectTimeout, STREAM_CLIENT_CONNECT, $streamContext);

		if (!$this->_hSocket) {
			throw new ApnsPHP_Exception(
				"Unable to connect to '{$sURL}': {$sError} ({$nError})"
			);
		}

		stream_set_blocking($this->_hSocket, 0);
		stream_set_write_buffer($this->_hSocket, 0);

		$this->_log("INFO: Connected to {$sURL}.");

		return true;
	}