Skip to content

Commit

Permalink
Ignore config file exceptions in install tool
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Apr 14, 2021
1 parent 447fa19 commit 2f8d2c2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/CustomElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -1393,6 +1393,7 @@ function ($count) {
}
}

$saveToCache = true;
$elements = array();

foreach ($templates as $template => $label) {
Expand Down Expand Up @@ -1422,7 +1423,19 @@ function ($count) {
}
}

$config = include $configPath;
try {
$config = include $configPath;
}
catch (\Throwable $exception) {
$request = System::getContainer()->get('request_stack')->getCurrentRequest();

if ($request && $request->get('_route') === 'contao_install') {
$saveToCache = false;
continue;
}

throw $exception;
}

$element = array(
'config' => $config,
Expand Down Expand Up @@ -1521,6 +1534,10 @@ function ($count) {

}

if (!$saveToCache) {
return;
}

$file = new \File($filePaths['path'], true);
$file->write(implode("\n", $contents));
$file->close();
Expand Down

0 comments on commit 2f8d2c2

Please sign in to comment.