Create HttpTransportAdapter based on configuration

@param $serverConfig
@return Apache_Solr_HttpTransport_Abstract
497136
private static function getHttpTransportAdapter($serverConfig)
    {
        switch ($serverConfig->getHttpTransportMethod()) {
            case HttpTransportMethod::HTTP_TRANSPORT_METHOD_CURL:
                $adapter = new Apache_Solr_HttpTransport_Curl();
                break;
            default:
                $adapter = new Apache_Solr_HttpTransport_FileGetContents();
        }

        if ($serverConfig->isUseHttpBasicAuth()) {
            $adapter->setAuthenticationCredentials(
                $serverConfig->getHttpBasicAuthUsername(),
                $serverConfig->getHttpBasicAuthPassword()
            );
        }

        return $adapter;
    }
1305482
public function importBusinessUnitUser(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->getCompanyBusinessUnitUserDataImport()->import($dataImporterConfigurationTransfer);
    }
1143159
public function createConnector(array $config)
    {
        if (!isset($config['driver'])) {
            throw new InvalidArgumentException('A driver must be specified.');
        }

        if ($this->container->has($key = "db.connector.{$config['driver']}")) {
            return $this->container->get($key);
        }

        switch ($config['driver']) {
            case 'mysql':
                return new MySqlConnector;
            case 'pgsql':
                return new PostgresConnector;
            case 'sqlite':
                return new SQLiteConnector;
            case 'sqlsrv':
                return new SqlServerConnector;
        }

        throw new InvalidArgumentException("Unsupported driver [{$config['driver']}]");
    }
1258596
public function importProductListProductConcrete(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->createProductListProductConcreteDataImport()
            ->import($dataImporterConfigurationTransfer);
    }
506368
private static ServerTransportConfig convertConfig(ServerConfig serverConfig) {
        ServerTransportConfig serverTransportConfig = new ServerTransportConfig();
        serverTransportConfig.setPort(serverConfig.getPort());
        serverTransportConfig.setProtocolType(serverConfig.getProtocol());
        serverTransportConfig.setHost(serverConfig.getBoundHost());
        serverTransportConfig.setContextPath(serverConfig.getContextPath());
        serverTransportConfig.setBizMaxThreads(serverConfig.getMaxThreads());
        serverTransportConfig.setBizPoolType(serverConfig.getThreadPoolType());
        serverTransportConfig.setIoThreads(serverConfig.getIoThreads());
        serverTransportConfig.setChannelListeners(serverConfig.getOnConnect());
        serverTransportConfig.setMaxConnection(serverConfig.getAccepts());
        serverTransportConfig.setPayload(serverConfig.getPayload());
        serverTransportConfig.setTelnet(serverConfig.isTelnet());
        serverTransportConfig.setUseEpoll(serverConfig.isEpoll());
        serverTransportConfig.setBizPoolQueueType(serverConfig.getQueueType());
        serverTransportConfig.setBizPoolQueues(serverConfig.getQueues());
        serverTransportConfig.setDaemon(serverConfig.isDaemon());
        serverTransportConfig.setParameters(serverConfig.getParameters());
        serverTransportConfig.setContainer(serverConfig.getTransport());
        return serverTransportConfig;
    }
77460
public function getExporter(?string $connection = null): AbstractExporter
    {
        $config = $this->config->extract('database');

        // Check is new or legacy
        if ($config->get('connections')) {
            $connection = $connection ?: $config->get('connection', 'local');

            $config = $config->extract('connections.' . $connection);
        }

        $driver = $config->get('driver', 'mysql');

        $class = 'Windwalker\Core\Database\Exporter\\' . ucfirst($driver) . 'Exporter';

        return $this->container->createSharedObject($class);
    }
13223
protected function createAdapter(string $adapter, array $config): Adapter
    {
        if ($adapter === 'Local') {
            if (! isset($config['config']['path'])) {
                throw new RuntimeException('Filesystem local adapter must set `path`');
            }

            $config = [$config['config']['path']];
        }

        return Reflection::newInstance(
            'One\\FileSystem\\Adapters\\' . $adapter,
            $config
        );
    }
1275507
public function importShoppingLists(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getShoppingListDataImporter()
            ->import($dataImporterConfigurationTransfer);
    }
4197
protected function getHttpClient( $config )
	{
		$guzzleConfig = Arr::get( $config, 'guzzle', [] );

		return new HttpClient( Arr::add( $guzzleConfig, 'connect_timeout', 60 ) );
	}
1363844
protected function createTransport(array $config)
    {
        if (!isset($config['class'])) {
            $config['class'] = 'Swift_SendmailTransport';
        }
        if (isset($config['plugins'])) {
            $plugins = $config['plugins'];
            unset($config['plugins']);
        } else {
            $plugins = [];
        }

        if ($this->enableSwiftMailerLogging) {
            $plugins[] = [
                'class' => 'Swift_Plugins_LoggerPlugin',
                'constructArgs' => [
                    [
                        'class' => 'yii\swiftmailer\Logger'
                    ]
                ],
            ];
        }

        /* @var $transport \Swift_Transport */
        $transport = $this->createSwiftObject($config);
        if (!empty($plugins)) {
            foreach ($plugins as $plugin) {
                if (is_array($plugin) && isset($plugin['class'])) {
                    $plugin = $this->createSwiftObject($plugin);
                }
                $transport->registerPlugin($plugin);
            }
        }

        return $transport;
    }
714546
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createMerchantDataImport()->import($dataImporterConfigurationTransfer);
    }
671939
protected function hasherProviderFactory($config){
        $hasher  = $config['hasher'];
        switch ($hasher)
        {
            case 'native':
                return new NativeHasher;
                break;

            case 'bcrypt':
                return new BcryptHasher;
                break;

            case 'sha256':
                return new Sha256Hasher;
                break;

            case 'whirlpool':
                return new WhirlpoolHasher;
                break;
        }

        throw new \InvalidArgumentException("Invalid hasher [$hasher] chosen for Sentry.");
    }
1056637
public function importProductMeasurementBaseUnit(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getProductMeasurementBaseUnitDataImporter()
            ->import($dataImporterConfigurationTransfer);
    }
728028
function handleServerConfig (serverConfig) {
	if (!serverConfig) {
		return defaultServerConfig;
	} else if (!serverConfig.hasOwnProperty('hostname') || !serverConfig.hasOwnProperty('port')) {
		return defaultServerConfig;
	}

	return serverConfig;
}
1123189
protected function newSerializer(ResourceConfiguration $config)
    {
        return new JMSSerializer(
            SerializerBuilder::create()->build(),
            new SerializationContext,
            new JMSPropertyExcluder($config->getExcludedProperties())
        );
    }
853185
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->createPriceProductDataImport()
            ->import($dataImporterConfigurationTransfer);
    }
1260408
public function importCompanyRoles(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createCompanyRoleDataImport()->import($dataImporterConfigurationTransfer);
    }