Gets the file cache directory.

@param   array               $cacheConfig
@param   ContainerBuilder    $container
@return  string
979118
private function getFileCacheDir(array $cacheConfig, ContainerBuilder $container)
    {
        $dir = sprintf('%s/as3_modlr', $container->getParameter('kernel.cache_dir'));
        if (isset($cacheConfig['parameters']['dir'])) {
            $dir = $cacheConfig['parameters']['dir'];
        }
        return $dir;
    }
753837
private function getAppDir(ContainerBuilder $container): string
    {
        if ($container->hasParameter('kernel.project_dir')) {
            return (string) $container->getParameter('kernel.project_dir') . '/' . (string) $container->getParameter('kernel.name');
        }

        return (string) $container->getParameter('kernel.root_dir');
    }
337945
public function load(ContainerBuilder $container, array $config)
    {
        $container->setParameter('genesis.failaid.config.screenshotDirectory', $config['screenshotDirectory']);
        $container->setParameter('genesis.failaid.config.screenshotMode', $config['screenshotMode']);

        if (! isset($config['debugBarSelectors'])) {
            $config['debugBarSelectors'] = [];
        }
        $container->setParameter('genesis.failaid.config.debugBarSelectors', $config['debugBarSelectors']);

        if (! isset($config['siteFilters'])) {
            $config['siteFilters'] = [];
        }
        $container->setParameter('genesis.failaid.config.siteFilters', $config['siteFilters']);

        $definition = new Definition(Initializer::class, [
            '%genesis.failaid.config.screenshotDirectory%',
            '%genesis.failaid.config.screenshotMode%',
            '%genesis.failaid.config.siteFilters%',
            '%genesis.failaid.config.debugBarSelectors%',
        ]);
        $definition->addTag(ContextExtension::INITIALIZER_TAG);
        $container->setDefinition(self::CONTEXT_INITIALISER, $definition);
    }
670834
public static function getCacheObject($cacheConfig = 'default')
    {
            //Check if the caller requests an new object
        if (empty(static::$instance[$cacheConfig])) {
            $config = Helper::getConfig('application', $cacheConfig);

            //Check if the object already be created
            if (isset($config["cache"][$cacheConfig])) {
                static::$instance[$cacheConfig] = new $config["cache"][$cacheConfig]['class'];
            } else {
                throw new \Exception("There is no cache config defined ({$cacheConfig})");
            }
        }

        return static::$instance[$cacheConfig];

    }
724208
public function load(array $config, ContainerBuilder $container)
    {
        $container->addObjectResource($this);

        $configuration = $this->getConfiguration($config, $container);
        if ($configuration instanceof ConfigurationInterface) {
            $config = $this->processConfiguration($configuration, $config);
            $this->applyParametrizedValues($config, $container);
        }

        $configFiles = $this->getConfigFiles($config);
        if (!empty($configFiles)) {
            $this->loadFiles($configFiles, $container);
        }

        $this->postLoad($config, $container);
    }
708201
private function getFileSystem(ContainerInterface $container): FileSystemInterface
    {
        assert($container->has(FileSystemInterface::class));

        /** @var FileSystemInterface $fileSystem */
        $fileSystem = $container->get(FileSystemInterface::class);

        return $fileSystem;
    }
753589
protected function addCacheDirectory(ContainerInterface $container, SerializerBuilder $builder): void
    {
        $config = $container->get('config');
        $libraryConfig = $config[ConfigKey::PROJECT][ConfigKey::API_CLIENT] ?? [];
        $cacheDir = (string) ($libraryConfig[ConfigKey::CACHE_DIR] ?? '');

        if ($cacheDir !== '') {
            $builder->setCacheDir($cacheDir);
        }
    }
912105
protected function loadProfilerStorage(array $config, ContainerBuilder $container, XmlFileLoader $loader)
    {
        $loader->load('profiler_storage.xml');

        $container->setParameter('snc_redis.profiler_storage.client', $config['profiler_storage']['client']);
        $container->setParameter('snc_redis.profiler_storage.ttl', $config['profiler_storage']['ttl']);

        $client = $container->getParameter('snc_redis.profiler_storage.client');
        $client = sprintf('snc_redis.%s', $client);
        $container->setAlias('snc_redis.profiler_storage.client', $client);
    }
417737
public static function cacheDI(ContainerBuilder $container, array $options)
    {
        $class = $options['class'] ?: '';
        if (!$class) {
            return null;
        }

        $exploded = explode('\\', $class);
        $config = array_merge($options, [
            'class' => array_pop($exploded),
            'namespace' => implode('\\', $exploded),
        ]);

        $dumper = new PhpDumper($container);
        if (class_exists(ProxyDumper::class)) {
            $dumper->setProxyDumper(new ProxyDumper);
        }

        return $dumper->dump($config);
    }
457547
public static function getCacheDirectories(&$config, $silent = false) {
		$cacheDirectory = self::initialGetCacheDirectory ( $config );
		$rootDS = \ROOT . \DS;
		if (! $silent) {
			echo "cache directory is " . UFileSystem::cleanPathname ( $rootDS . $cacheDirectory ) . "\n";
		}
		$cacheDirectory = $rootDS . $cacheDirectory . \DS;
		$modelsDir = str_replace ( "\\", \DS, $config ["mvcNS"] ["models"] );
		$controllersDir = str_replace ( "\\", \DS, $config ["mvcNS"] ["controllers"] );
		$annotationCacheDir = $cacheDirectory . "annotations";
		$modelsCacheDir = $cacheDirectory . $modelsDir;
		$queriesCacheDir = $cacheDirectory . "queries";
		$controllersCacheDir = $cacheDirectory . $controllersDir;
		$viewsCacheDir = $cacheDirectory . "views";
		$seoCacheDir = $cacheDirectory . "seo";
		$gitCacheDir = $cacheDirectory . "git";
		$contentsCacheDir = $cacheDirectory . "contents";
		return [ "annotations" => $annotationCacheDir,"models" => $modelsCacheDir,"controllers" => $controllersCacheDir,"queries" => $queriesCacheDir,"views" => $viewsCacheDir,"seo" => $seoCacheDir,"git" => $gitCacheDir,"contents" => $contentsCacheDir ];
	}
592222
protected function createManager(Container $container, ConfigRepository $config)
    {
        $filesystem = $container->make('filesystem');
        $factory    = $container->make(FileFactoryContract::class);
        $storage    = $container->make(FileStorageContract::class);

        $fileManager = new FileManager($filesystem, $factory, $storage);

        $this->configureManager($fileManager, $container, $config->get('filemanager', []));

        return $fileManager;
    }
658270
private function createCache(array $config, ContainerBuilder $container)
    {
        $type = $config['type'];
        if (array_key_exists($type, $this->cacheFactories)) {
            $id = sprintf('tbbc_cache.%s_cache', $config['name']);
            $this->cacheFactories[$type]->create($container, $id, $config);

            return $id;
        }

        // TODO: throw exception ?
    }
517789
private function resolveMappingPaths(array $config, ContainerBuilder $container)
    {
        $paths = [];

        if ($config['auto']['enabled']) {
            $bundles = $container->getParameter('kernel.bundles');

            foreach ($bundles as $bundle) {
                $bundlePath = dirname((new \ReflectionClass($bundle))->getFileName());

                foreach ($config['auto']['paths'] as $relativePath) {
                    $path = $bundlePath.'/'.$relativePath;

                    if (file_exists($path)) {
                        $paths[] = $path;
                    }
                }
            }
        }

        return array_merge($paths, $config['paths']);
    }
816064
protected function loadStorageEngine($config, ContainerBuilder $container)
    {
        $parametersStorageServiceDef = $container->getDefinition('wizad_settings.dal.parameters_storage');

        if (isset($config['redis'])) {
            $this->prepareRedisStorageEngine($config['redis'], $container, $parametersStorageServiceDef);
        } elseif (isset($config['mysql'])) {
            $this->prepareMysqlStorageEngine($config['mysql'], $container, $parametersStorageServiceDef);
        } else {
            throw new \Exception('Unsupported storage');
        }

        $parametersStorageServiceDef->addArgument($container->getParameter('wizad_settings.config.storage'));
        return $container->get('wizad_settings.dal.parameters_storage');
    }
713569
protected function loadDoctrine(array $config, ContainerBuilder $container)
    {
        foreach ($config['doctrine'] as $name => $cache) {
            $pool = new Reference(sprintf('memcache.%s', $cache['pool']));
            foreach ($cache['entity_managers'] as $em) {
                $def = new Definition($container->getParameter('memcache.doctrine_cache.class'));
                if (method_exists($def, 'setShared')) { // Symfony 2.8+
                    $def->setShared(true);
                } else { // For Symfony <2.8 compatibility
                    $def->setScope(ContainerInterface::SCOPE_CONTAINER);
                }
                $def->addMethodCall('setMemcache', array($pool));
                if ($cache['prefix']) {
                    $def->addMethodCall('setPrefix', array($cache['prefix']));
                }
                $container->setDefinition(sprintf('doctrine.orm.%s_%s', $em, $name), $def);
            }
            foreach ($cache['document_managers'] as $dm) {
                $def = new Definition($container->getParameter('memcache.doctrine_cache.class'));
                if (method_exists($def, 'setShared')) { // Symfony 2.8+
                    $def->setShared(true);
                } else { // For Symfony <2.8 compatibility
                    $def->setScope(ContainerInterface::SCOPE_CONTAINER);
                }
                $def->addMethodCall('setMemcache', array($pool));
                if ($cache['prefix']) {
                    $def->addMethodCall('setPrefix', array($cache['prefix']));
                }
                $container->setDefinition(sprintf('doctrine.odm.mongodb.%s_%s', $dm, $name), $def);
            }
        }
    }
1360038
private function loadCore(ContainerBuilder $container, Loader\YamlFileLoader $loader, $config)
    {
        $isCacheEnabled = $config['metadata_cache'];

        $container->setParameter('ma27_api_key_authentication.model_name', $config['model_name']);
        $container->setParameter('ma27_api_key_authentication.object_manager', $config['object_manager']);
        $container->setParameter('ma27_api_key_authentication.property.apiKeyLength', $config['api_key_length']);
        $container->setParameter('ma27_api_key_authentication.metadata_cache_enabled', $isCacheEnabled);

        if ($isCacheEnabled) {
            $loader->load('metadata_cache_warmer.yml');
        }

        $this->loadPassword($container, $config['password'], $loader);
    }
700238
public function load(array $config, ContainerBuilder $container)
    {
        $rClass = new \ReflectionClass($this);

        $yamlLoader = new YamlFileLoader(
            $container,
            new FileLocator(dirname($rClass->getFileName()) . '/Resources/config')
        );

        $xmlLoader = new XmlFileLoader(
            $container,
            new FileLocator(dirname($rClass->getFileName()) . '/Resources/config')
        );

        $phpLoader = new PhpFileLoader(
            $container,
            new FileLocator(dirname($rClass->getFileName()) . '/Resources/config')
        );

        $this->registerCustom($container, $config);
        $this->registerConfigFiles($yamlLoader);
        $this->registerYamlConfigFiles($yamlLoader);
        $this->registerXmlConfigFiles($xmlLoader);
        $this->registerPhpConfigFiles($phpLoader);
        $this->registerCompilerPasses($container);

        /** @var CliApplication $application */
        $application = $container->get('application');

        $this->registerCommands($application);

        /** @var TemplatingServiceInterface $templatingService */
        $templatingService = $container->get('common.services.templating');
        $this->registerTemplates($templatingService);
    }