Commit 18f41b1d authored by totten's avatar totten

Make repo dir configurable (`publisher_repos_dir`)

parent d8b03f90
......@@ -48,14 +48,22 @@ class AppKernel extends Kernel
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
}
protected function initializeContainer()
protected function buildContainer()
{
parent::initializeContainer();
if ($this->getContainer()->hasParameter('mkdocs_path')) {
$_ENV['PATH'] = $this->getContainer()->getParameter('mkdocs_path')
$container = parent::buildContainer();
if ($container->hasParameter('mkdocs_path')) {
$_ENV['PATH'] = $container->getParameter('mkdocs_path')
. PATH_SEPARATOR . getenv('PATH');
putenv("PATH=" . $_ENV['PATH']);
}
if (!$container->hasParameter('publisher_repos_dir')) {
// This isn't really a good place to put it because it gets deleted
// whenever you clear the cache.
$container->setParameter('publisher_repos_dir',
$container->getParameter('kernel.cache_dir') . '/repos'
);
}
return $container;
}
......
......@@ -20,3 +20,5 @@ parameters:
# Load mkdocs from a non-standard directory, e.g.
# mkdocs_path: /Applications/MAMP/Library/bin
# publisher_repos_dir: '%kernel.root_dir%/repos'
......@@ -12,7 +12,7 @@ services:
arguments: ['@publisher']
publisher:
class: AppBundle\Utils\Publisher
arguments: ['@request_stack', '@publish.logger', '@filesystem', %kernel.root_dir%/config/books, %kernel.cache_dir%/repos, %kernel.root_dir%/../web/static]
arguments: ['@request_stack', '@publish.logger', '@filesystem', %kernel.root_dir%/config/books, %publisher_repos_dir%, %kernel.root_dir%/../web/static]
publish.logger:
class: Monolog\Logger
arguments: ['publish', ['@streamhandler']]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment