Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '4.x' into feature/canonical
- Loading branch information
Showing
115 changed files
with
1,672 additions
and
978 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
core-bundle/src/Controller/ContentElement/TemplateController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of Contao. | ||
* | ||
* (c) Leo Feyer | ||
* | ||
* @license LGPL-3.0-or-later | ||
*/ | ||
|
||
namespace Contao\CoreBundle\Controller\ContentElement; | ||
|
||
use Contao\ContentModel; | ||
use Contao\StringUtil; | ||
use Contao\Template; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class TemplateController extends AbstractContentElementController | ||
{ | ||
protected function getResponse(Template $template, ContentModel $model, Request $request): ?Response | ||
{ | ||
$this->initializeContaoFramework(); | ||
|
||
$template->data = StringUtil::deserialize($model->data, true); | ||
|
||
return $template->getResponse(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
core-bundle/src/Controller/FrontendModule/TemplateController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of Contao. | ||
* | ||
* (c) Leo Feyer | ||
* | ||
* @license LGPL-3.0-or-later | ||
*/ | ||
|
||
namespace Contao\CoreBundle\Controller\FrontendModule; | ||
|
||
use Contao\ModuleModel; | ||
use Contao\StringUtil; | ||
use Contao\Template; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
class TemplateController extends AbstractFrontendModuleController | ||
{ | ||
protected function getResponse(Template $template, ModuleModel $model, Request $request): ?Response | ||
{ | ||
$this->initializeContaoFramework(); | ||
|
||
$template->data = StringUtil::deserialize($model->data, true); | ||
|
||
return $template->getResponse(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
core-bundle/src/Doctrine/ORM/FailTolerantProxyCacheWarmer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of Contao. | ||
* | ||
* (c) Leo Feyer | ||
* | ||
* @license LGPL-3.0-or-later | ||
*/ | ||
|
||
namespace Contao\CoreBundle\Doctrine\ORM; | ||
|
||
use Doctrine\DBAL\Connection; | ||
use Doctrine\DBAL\Exception as DoctrineDbalException; | ||
use Symfony\Bridge\Doctrine\CacheWarmer\ProxyCacheWarmer; | ||
|
||
class FailTolerantProxyCacheWarmer extends ProxyCacheWarmer | ||
{ | ||
private ProxyCacheWarmer $inner; | ||
private Connection $connection; | ||
|
||
public function __construct(ProxyCacheWarmer $inner, Connection $connection) | ||
{ | ||
$this->inner = $inner; | ||
$this->connection = $connection; | ||
} | ||
|
||
public function isOptional(): bool | ||
{ | ||
return (bool) $this->inner->isOptional(); | ||
} | ||
|
||
/** | ||
* @return array<string> | ||
*/ | ||
public function warmUp(string $cacheDir): array | ||
{ | ||
// If there are no DB credentials yet (install tool) and the | ||
// server_version was not configured, we have to skip the ORM warmup to | ||
// prevent a DBAL exception during the automatic version detection | ||
try { | ||
$this->connection->getDatabasePlatform(); | ||
} catch (DoctrineDbalException | \mysqli_sql_exception $e) { | ||
return []; | ||
} | ||
|
||
$this->inner->warmUp($cacheDir); | ||
|
||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.