Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing of theme.yml #2059

Merged
merged 1 commit into from
Oct 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Configuration/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class Config
/** @var Stopwatch */
private $stopwatch;

/** @var string */
private $publicFolder;

/** @var CacheInterface */
private $cache;

Expand All @@ -53,14 +56,15 @@ public function __construct(string $locales, string $defaultLocale, Stopwatch $s
$this->stopwatch = $stopwatch;
$this->cache = $cache;
$this->projectDir = $projectDir;
$this->publicFolder = $publicFolder;
$this->defaultLocale = $defaultLocale;
$this->clearCacheController = $clearCacheController;
$this->kernel = $kernel;

$this->data = $this->getConfig();

// @todo PathResolver shouldn't be part of Config. Refactor to separate class
$this->pathResolver = new PathResolver($projectDir, $this->get('general/theme'), $publicFolder);
$this->pathResolver = new PathResolver($projectDir, $this->get('general/theme'), $this->publicFolder);
}

private function getConfig(): Collection
Expand Down Expand Up @@ -114,7 +118,7 @@ private function parseConfig(): array

// If we're parsing the config, we'll also need to pre-initialise
// the PathResolver, because we need to know the theme path.
$this->pathResolver = new PathResolver($this->projectDir, $config->get('general')->get('theme'));
$this->pathResolver = new PathResolver($this->projectDir, $config->get('general')->get('theme'), $this->publicFolder);

$theme = new ThemeParser($this->projectDir, $this->getPath('theme'));
$config['theme'] = $theme->parse();
Expand Down