Create an instance of the file cache driver.

        :param config: The driver configuration
        :type config: dict

        :rtype: Repository
542128
def _create_file_driver(self, config):
        
        kwargs = {
            'directory': config['path']
        }

        if 'hash_type' in config:
            kwargs['hash_type'] = config['hash_type']

        return self.repository(FileStore(**kwargs))
998631
def cache_url_config(cls, url, backend=None):
        
        url = urlparse(url) if not isinstance(url, cls.URL_CLASS) else url

        location = url.netloc.split(',')
        if len(location) == 1:
            location = location[0]

        config = {
            'BACKEND': cls.CACHE_SCHEMES[url.scheme],
            'LOCATION': location,
        }

        # Add the drive to LOCATION
        if url.scheme == 'filecache':
            config.update({
                'LOCATION': url.netloc + url.path,
            })

        if url.path and url.scheme in ['memcache', 'pymemcache']:
            config.update({
                'LOCATION': 'unix:' + url.path,
            })
        elif url.scheme.startswith('redis'):
            if url.hostname:
                scheme = url.scheme.replace('cache', '')
            else:
                scheme = 'unix'
            locations = [scheme + '://' + loc + url.path for loc in url.netloc.split(',')]
            config['LOCATION'] = locations[0] if len(locations) == 1 else locations

        if url.query:
            config_options = {}
            for k, v in parse_qs(url.query).items():
                opt = {k.upper(): _cast(v[0])}
                if k.upper() in cls._CACHE_BASE_OPTIONS:
                    config.update(opt)
                else:
                    config_options.update(opt)
            config['OPTIONS'] = config_options

        if backend:
            config['BACKEND'] = backend

        return config
404620
def create_from_config(self, config):
        

        configService = ConfigService()
        template = TemplateService()

        template.output = config["output"]["location"]

        template_file = configService.get_template_from_config(config)
        template.input = os.path.basename(template_file)
        template.env = Environment(loader=FileSystemLoader(os.path.dirname(template_file)))

        return template
681776
def configure(self, config):
        
        credentials = CredentialParams.many_from_config(config)
        for credential in credentials:
            self._credentials.append(credential)
1046751
public void load(FileConfiguration config) {
        this.config = config;
        
        try {
            parse();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
    }
1257210
def _create_driver(self, **kwargs):
        
        if self.driver is None:
            self.driver = self.create_driver(**kwargs)
            self.init_driver_func(self.driver)
701581
private function createConfigurationDriver()
    {
        $reflection = new \ReflectionClass($this->driverClass());

        /** @var ConfigurationInterface $config */
        $config = $reflection->hasMethod('__construct')
            ? $reflection->newInstanceArgs([$this->file])
            : $reflection->newInstance();
        return $config;
    }
1289921
def configure(defaults, metadata, loader):
    
    config = Configuration(defaults)
    config.merge(loader(metadata))
    validate(defaults, metadata, config)
    return config
425133
def __create(self):
        
        self.__data = json.dumps({
            'config_path': self.encode(self.config_path),
            'subject': self.encode(self.__subject),
            'text': self.encode(self.__text),
            'html': self.encode(self.__html),
            'files': self.__files,
            'send_as_one': self.send_as_one,
            'addresses': self.__addresses,
            'ccs': self.__ccs,
        })
1068071
public static Cache getInstance(CacheConnection cc, Config config) throws IOException {
	return cc.getInstance(config);
    }
489853
protected function registerCache($cacheConfig)
    {
        switch ($cacheConfig['driver']) {
            case 'filesystem':
                $cacheDriver = new FilesystemCache($cacheConfig['dir']);
                break;
            default:
                $cacheDriver = new FilesystemCache(sys_get_temp_dir());
        }

        return $cacheDriver;
    }
145641
private static function createConfiguration(array $config, ContainerInterface $container = null)
    {
        $cache = $config['cache'];

        if ($container && is_string($config['cache']) && $container->has($config['cache'])) {
            $cache = $container->get($config['cache']);
        }

        return Setup::createConfiguration($config['debug'], $config['proxy_dir'], $cache);
    }
89835
public static function init(&$config) {
		$controllers = CacheManager::getControllers ();
		foreach ( $controllers as $controller ) {
			CacheManager::$cache->remove( self::getControllerCacheKey ( $controller ));
			$parser = new DiControllerParser ();
			$parser->parse ( $controller, $config );
			$injections = $parser->getInjections ();
			if (sizeof ( $injections ) > 0) {
				self::store ( $controller, $parser->__toString () );
			}
		}
	}
771534
def create_driver(self):
        
        driver_type = self.config.get('Driver', 'type')
        try:
            if self.config.getboolean_optional('Server', 'enabled'):
                self.logger.info("Creating remote driver (type = %s)", driver_type)
                driver = self._create_remote_driver()
            else:
                self.logger.info("Creating local driver (type = %s)", driver_type)
                driver = self._create_local_driver()
        except Exception as exc:
            error_message = get_error_message_from_exception(exc)
            self.logger.error("%s driver can not be launched: %s", driver_type.capitalize(), error_message)
            raise

        return driver
1206331
protected function createProjectConfiguration(stdClass $config = null)
    {
        if (null === $config) {
            return new ProjectConfiguration(
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                $this->defaultCacheDir()
            );
        }

        $configData = new ObjectAccess($config);

        $cacheDir = $configData->getDefault('cache-dir');
        if (null === $cacheDir) {
            $cacheDir = $this->defaultCacheDir();
        }

        return new ProjectConfiguration(
            $configData->getDefault('process-timeout'),
            $configData->getDefault('use-include-path'),
            $this->createInstallationMethod(
                $configData->getDefault('preferred-install')
            ),
            $configData->getDefault('github-protocols'),
            $this->objectToArray($configData->getDefault('github-oauth')),
            $configData->getDefault('vendor-dir'),
            $configData->getDefault('bin-dir'),
            $cacheDir,
            $configData->getDefault('cache-files-dir'),
            $configData->getDefault('cache-repo-dir'),
            $configData->getDefault('cache-vcs-dir'),
            $configData->getDefault('cache-files-ttl'),
            $configData->getDefault('cache-files-maxsize'),
            $configData->getDefault('prepend-autoloader'),
            $configData->getDefault('autoloader-suffix'),
            $configData->getDefault('optimize-autoloader'),
            $configData->getDefault('github-domains'),
            $configData->getDefault('notify-on-install'),
            $this->createVcsChangePolicy(
                $configData->getDefault('discard-changes')
            ),
            $configData->data()
        );
    }
1321911
public void loadConfig(String config)
        throws IOException
    {
        Properties properties = new Properties();
        Resource resource=Resource.newResource(config);
        properties.load(resource.getInputStream());
        
        _jdbcDriver = properties.getProperty("jdbcdriver");
        _url = properties.getProperty("url");
        _userName = properties.getProperty("username");
        _password = properties.getProperty("password");
        _userTable = properties.getProperty("usertable");
        _userTableKey = properties.getProperty("usertablekey");
        _userTableUserField = properties.getProperty("usertableuserfield");
        _userTablePasswordField = properties.getProperty("usertablepasswordfield");
        _roleTable = properties.getProperty("roletable");
        _roleTableKey = properties.getProperty("roletablekey");
        _roleTableRoleField = properties.getProperty("roletablerolefield");
        _userRoleTable = properties.getProperty("userroletable");
        _userRoleTableUserKey = properties.getProperty("userroletableuserkey");
        _userRoleTableRoleKey = properties.getProperty("userroletablerolekey");
        _cacheTime = new Integer(properties.getProperty("cachetime")).intValue();
        
        if (_jdbcDriver == null || _jdbcDriver.equals("")
            || _url == null || _url.equals("")
            || _userName == null || _userName.equals("")
            || _password == null
            || _cacheTime < 0)
        {
            if(log.isDebugEnabled())log.debug("UserRealm " + getName()
                        + " has not been properly configured");
        }
        _cacheTime *= 1000;
        _lastHashPurge = 0;
        _userSql = "select " + _userTableKey + ","
            + _userTablePasswordField + " from "
            + _userTable + " where "
            + _userTableUserField + " = ?";
        _roleSql = "select r." + _roleTableRoleField
            + " from " + _roleTable + " r, "
            + _userRoleTable + " u where u."
            + _userRoleTableUserKey + " = ?"
            + " and r." + _roleTableKey + " = u."
            + _userRoleTableRoleKey;
    }
1150433
def inject_config(self, config, from_args):
    

    load_libs = self._get_libs()

    all_libs = {}
    found_libs = []
    
    for root, dirs, files in os.walk(library_path):
      for f in files:
        if not f.endswith('.so'):
          continue

        full_path = os.path.join(root, f)
        if '.' in f:
          name, ext = f.split('.', 1)
        else:
          name = f

        if name in all_libs:
          all_libs[name].append(full_path)
        else:
          all_libs[name] = [full_path]

    for lib in load_libs:
      if 'lib' + lib in all_libs:
        p = list(sorted(all_libs['lib' + lib], key=lambda x: len(x))).pop()
        v = '--volume={0}:{1}'.format(os.path.realpath(p), p)
        config.append(v)
      else:
        print('*** Unknown lib: {}'.format(lib))
        sys.exit(1)