Returns the same VCRFactory instance on ever call (singleton).

@param  Configuration $config (Optional) configuration.

@return VCRFactory
193351
public static function getInstance(Configuration $config = null)
    {
        if (!self::$instance) {
            self::$instance = new self($config);
        }

        return self::$instance;
    }
492132
public static function create($config)
    {

        $clientBuilder = ClientBuilder::create();

        if (!empty($config['handler'])) {
            $clientBuilder->setHandler($config['handler']);
        }

        $clientBuilder->setHosts($config["servers"]);

        $clientBuilder = self::configureLogging($clientBuilder,$config);

        $query = new Query($clientBuilder->build());

        if (array_key_exists("index", $config) and $config["index"] != "") {
            $query->index($config["index"]);
        }

        return $query;
    }
619791
static public function factory($config = array()) {
        if (is_string($config)) {
            // Assume $config is a filename
            $filename = $config;
            $config = array(
                'timestampFormat' => 'Y-m-d',
                array(
                    'writerName' => 'Stream',
                    'writerParams' => array(
                        'stream' => self::_getLoggingDirectory() . DIRECTORY_SEPARATOR . $filename
                    )
                )
            );
        }
        return parent::factory($config);
    }
430113
public static function make(array $config)
    {
        $builder = self::getBuilder();
        $configObject = $builder->build($config);
        $grid = new Grid($configObject);
        return $grid;
    }
1282443
public static function get($config = []) {
        $key = md5(get_called_class() . serialize($config));
        if (!isset(self::$_instances[$key]))
            self::$_instances[$key] = new static($config);
        return self::$_instances[$key];
    }
1094569
public static function getInstance(Configuration $cfg) {
        $cache = null;
        if (extension_loaded('redis')) {
            $redisConfig = $cfg->get('redis');
            if ($redisConfig) {
                list($host, $port, $db, $timeout, $auth) = $redisConfig;
                $redis = RedisClient::getRedis([$host, $port, $timeout, $auth, $db]);
                if ($redis) {
                    $cache = new RedisCache($redis);
                }
            }
        }

        return $cache;
    }
146568
public static function factory($config = array())
	{
		$default = array();
		$required = array('base_url');
		$config = Inspector::prepareConfig($config, $default, $required);
		$client = new self($config->get('base_url'), $config->get('token'));
		$client->setConfig($config);
		$client->getEventDispatcher()->addSubscriber(new AuthenticationObserver());
		return $client;
	}
1035638
protected function getORMCompilerPass(array $config)
    {
        $nameSpace = 'Gesdinet\JWTRefreshTokenBundle\Entity';
        $mappings = array(
            realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-orm') => $nameSpace,
        );

        if (isset($config['refresh_token_class']) || isset($config['refresh_token_entity'])) {
            $mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-superclass')] = $nameSpace;
        } else {
            $mappings[realpath(dirname(dirname(__DIR__)).'/Resources/config/orm/doctrine-entity')] = $nameSpace;
        }

        return DoctrineOrmMappingsPass::createYamlMappingDriver($mappings);
    }
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.");
    }
803405
public function factory($type, array $config)
    {
        $this->setFactoryCreationOptions($type, $config);

        return $this->get($type, $config, false);
    }
498316
public static function getAdapter($config = null) {
		if (is_string($config)) {
			$config = Yesf::app()->getConfig('connection.' . $config);
		}
		if (!isset($config['adapter'])) {
			throw new ConnectionException("Unknown adapter");
		}
		$type = $config['adapter'];
		// Get connection
		$connection = Pool::get($config);
		$hash = spl_object_hash($connection);
		if (!isset(self::$created_adapter[$hash])) {
			if (isset(self::$adapter[$type])) {
				$className = self::$adapter[$type];
			} else {
				throw new ConnectionException("Unknown adapter");
			}
			$instance = new $className($connection);
			self::$created_adapter[$hash] = $instance;
			return $instance;
		} else {
			return self::$created_adapter[$hash];
		}
	}
358476
public static function instance($config = [])
    {
        if (null === self::$instance) {
            self::$instance = new static($config);
        }

        return self::$instance;
    }
331163
public function createFactory($config)
    {
        $this->fileService->mkdir(dirname($config['_path_factory_']), 0777, true);

        if (!file_exists($config['_path_factory_'])) {
            $this->putIfNotExists($config['_path_factory_'], '<?php');
        }

        $factory = $this->fileService->get($config['template_source'].'/Factory.txt');

        $factory = $this->tableService->getTableSchema($config, $factory);

        foreach ($config as $key => $value) {
            $factory = str_replace($key, $value, $factory);
        }

        return $this->filesystem->append($config['_path_factory_'], $factory);
    }
70966
protected function getBuilder(array $config)
    {
        $builder = new ClientBuilder();

        if ($backoff = array_get($config, 'backoff')) {
            $builder->addPlugin(new RetryPlugin(['retries' => $backoff === true ? 2 : $backoff]));
        }

        if ($this->cache && class_exists(CacheItemPool::class) && $cache = array_get($config, 'cache')) {
            $builder->addCache(new CacheItemPool($this->cache->store($cache === true ? null : $cache)));
        }

        return $builder;
    }
314977
protected function configFactory(): Config
	{
		return new Config(new Loader($this->container->get(FileSystem::class), $this->applicationPath . '/config'), $this->getEnvironment());
	}
1353472
protected function buildContainer($config)
    {
        $container = new ContainerBuilder(new ParameterBag($this->getParameters()));

        $this->prepareContainer($container);
        $this->getContainerLoader($container)->load($config);

        return $container;
    }
1085315
public static function getInstance($config=[],$force=false){
      if (is_null( self::$instance) || $force===true){
        self::$instance=new self($config);
      }

      return self::$instance;
    }