Set all needed paths by reading configured configuration.

Will provide "autoloading" inside templates.

@return void
498212
public function setPathsFromOptions($optionsPath = 'AtomicKitten.Framework.build.source.framework')
    {
        $configuration = $this->objectManager->get(ConfigurationManager::class)
            ->getConfiguration(
                ConfigurationManager::CONFIGURATION_TYPE_SETTINGS,
                $optionsPath
            );

        $this->setLayoutRootPath($configuration['layouts']);
        $this->setPartialRootPath($configuration['partials']);
        $this->setTemplatePathAndFilename($configuration['templates']);
    }
4920
private function configureDirs()
    {
        // Configure dirs from environment variables and composer extra values.
        foreach ($this->resolver->names() as $name) {
            $default = $this->resolver->raw($name);
            $path = $this->options->get($name . '-dir', $default);
            if ($path !== $default) {
                $this->verbose("Setting <info>$name</> path to <info>$path</>.");
                $this->resolver->define($name, $path);
            }
        }

        if ($this->io->confirm("Do you want to use Bolt's standard folder structure?")) {
            return;
        }

        (new PathCustomizer($this->resolver, $this->io))->run();

        $this->io->writeln("\n<info>Customizing!</info>\n");
    }
581239
protected function initConfig(): void
    {
        $configFile = $this->getRootRelatedPath($this->getConfigFileName());

        $this->assertFileIsReadable($configFile);

        self::$config = (array)(include $configFile);
    }
822927
public function loadConfig()
    {
        if ($this->configIsValid()) {
            return;
        }

        $this->yaml->loadToConfig($this->getConfigPath(), 'tddd', true)->toArray();
    }
647636
protected function bindPathsInContainer()
    {
        $this->instance('path.base',   $this->basePath());
        $this->instance('path.app',    $this->basePath('app'));
        $this->instance('path.config', $this->basePath('app/config'));
        $this->instance('path.theme',  $this->basePath('app/theme'));
        $this->instance('path.temp',   $this->basePath('app/temp'));
        $this->instance('path.lang',   $this->basePath('app/trans/langs'));
        $this->instance('path.jargon', $this->basePath('app/trans/jargons'));
    }
1317097
protected function setPaths()
    {
        $pathPackage = realpath(__DIR__.'/../../../../');
        $pathBase = realpath(base_path());

        // Set CLI path.
        $this->pathCli = $pathBase.'/vendor/bin/'.$this::CLI_TOOL;
        if (!file_exists($this->pathCli)) {
            $this->pathCli = $pathPackage.'/vendor/bin/'.$this::CLI_TOOL;
        }

        // Set ruleset paths.
        $this->pathRulesetStock = $pathPackage.'/rulesets/'.$this::CLI_TOOL.'.xml';
        $this->pathRulesetLocal = $pathBase.'/'.$this::CLI_TOOL.'.xml';
        $this->pathRulesetLocalLegacy = $pathBase.'/app/'.$this::CLI_TOOL.'.xml';

        // Set active ruleset.
        $this->pathRuleset = $this->pathRulesetStock;
        if (is_readable($this->pathRulesetLocal)) {
            $this->pathRuleset = $this->pathRulesetLocal;
        } elseif (is_readable($this->pathRulesetLocalLegacy)) {
            $this->pathRuleset = $this->pathRulesetLocalLegacy;
        }
    }
1002811
public function configure($name)
    {
        if (isset($this->loadedConfigurations[$name])) {
            return;
        }

        $this->loadedConfigurations[$name] = true;

        $path = $this->getConfigurationPath($name);

        if (! \is_null($path)) {
            $this->make('config')->set(Arr::dot([
                $name => require $path,
            ]));
        }
    }
601290
protected function setThemeAutoloading()
    {
        foreach ($this->config->get('theme.autoloading', []) as $ns => $path) {
            $path = $this->dirPath.'/'.trim($path, '\/');
            $this->loader->addPsr4($ns, $path);
        }

        $this->loader->register();
    }
30355
protected function initTemplates()
    {
        foreach ($this->templates as $template => $templatePath) {
            $this->templates[$template] = $this->normalizePath($templatePath);
        }

        if (!isset($this->templates['default'])) {
            $this->templates['default'] = realpath(dirname(__DIR__) . '/../templates/default');
        }
    }
316342
protected function configure()
    {
        $this
            ->setName('detect')
            ->setDefinition(
                [
                    new InputArgument('path', InputArgument::OPTIONAL, 'path of the project', null),
                    new InputOption(
                        'config-file',
                        'c',
                        InputOption::VALUE_REQUIRED,
                        'File path of the configuration file'
                    ),
                    new InputOption(
                        'format',
                        'f',
                        InputOption::VALUE_REQUIRED,
                        sprintf('Output format (%s)', implode(', ', $this->formats)),
                        $this->formats[0]
                    ),
                ]
            )
            ->setDescription('Detect coupling rules')
            ->setHelp($this->loadHelpContent());
    }
584133
private function setViewPath()
    {
        $viewPath = (strpos($this->getTwigViewPath(), '.') == true) ?
            str_replace('.', DS, $this->getTwigViewPath()) :
            $this->getTwigViewPath();

        $this->setTemplateLocation($this->container->get('app.path').DS.$viewPath.DS);
    }
530291
private function _set_config()
    {
	$ok = false;
	$this->_configs = array();

	if( $this->_file_lib->check_dir() )
	{
	    $all_configs_file = $this->_file_lib->get_path_files();

	    $wise = Wise::create( $this->_file_lib );
	    foreach( $all_configs_file as $service_name => $config_file )
	    {
		$this->_configs[$service_name] = $wise->loadFlat( $config_file );
	    }
	}

	return $ok;
    }
197159
protected function load()
    {
        if (!$this->isConfigurationLoaded) {
            $this->values = $this->getDefaults();
            $values = $this->getConfigStore()->load();
            if (is_array($values)) {
                $this->values = array_merge($this->getDefaults(), $values);
            }
            $this->values = $this->castValues($this->values);
            $this->isConfigurationLoaded = true;
        }
    }
214818
protected function configure()
    {
        $this
        ->setName($this->name)
        ->setDescription($this->description)
        ->setAliases($this->aliases)
        ->addOption(
          'env',
          null,
          InputOption::VALUE_REQUIRED,
          'Set the environment variable file',
          sprintf('%s/%s', getcwd(), '.craftsman')
        );
    }
1137938
protected function setCachePath()
    {
        $filename = basename($this->pathFile);

        $this->pathCache = $this->cacheDir . '/' . $filename;
    }
880245
protected function loadRoutes() : void
    {
        $routeConfig = Core::i()->config->getConfiguration('routes');
        // If there is a default route, make it last in the array
        if (isset($routeConfig['default'])) {
            $default_route = $routeConfig['default'];
            unset($routeConfig['default']);
            $routeConfig['default'] = $default_route;
        }
        // Parse the routes and build the regex strings
        foreach ($routeConfig as $route_name => $route) {
            $regex = $route['route'];
            $regex = str_replace('/', '\/', $regex);
            $regex = str_replace('[', '(', $regex);
            $regex = str_replace(']', ')?', $regex);
            if (isset($route['constraints'])) {
                foreach ($route['constraints'] as $key => $constraint) {
                    $regex = str_replace(':' . $key . ':', "(?P<{$key}>" . $constraint . ')', $regex);
                }
            }
            $routeConfig[$route_name]['regex'] = '/^' . $regex . '$/i';
        }
        $this->route_definitions = $routeConfig;
    }
1219569
private function _configure()
    {
        \Twig_Autoloader::register();

        $loader         =  new \Twig_Loader_Filesystem($this->_basePath);

        $cache_path = defined('CACHE_PATH') ? CACHE_PATH : 'cache';
        $this->_twig = new \Twig_Environment($loader,
            array(
                'debug'      => true,
                'autoreload' => false,
                'autoescape' => true,
                'cache'      => $cache_path,
            ));
        $this->_twig->getExtension('core')->setNumberFormat(2, '.', ',');
        //$this->_twig->addFilter(
            //'nonce',
            //new \Twig_Filter_Function(function($str) {
                //$app=$GLOBALS['app'];
                //if (strpos($str, '?') !== false) {
                    //return $str.'&rand_token='.$app->getSessionManager()->getActiveSession()->getAttribute('nonce');
                //}
                //return $str.'?rand_token='.$app->getSessionManager()->getActiveSession()->getAttribute('nonce');
        //})
        //);
        $this->_twig->addFilter(
            'truncate',
            new \Twig_Filter_Function('StringFilter::truncate')
        );
        $this->_twig->addFilter(
            'isToday',
            new \Twig_Filter_Function('DateFilter::isToday')
        );
        $this->_twig->addFilter(
            'isTomorrow',
            new \Twig_Filter_Function('DateFilter::isTomorrow')
        );
        $this->_twig->addFilter(
            'isLater',
            new \Twig_Filter_Function('DateFilter::isLater')
        );

    }