Skip to content

Commit

Permalink
IBX-3740: Prepended default Core settings (#182)
Browse files Browse the repository at this point in the history
For more details see https://issues.ibexa.co/browse/IBX-3740 and #182

* Dropped obsolete ezdesign parameter setup

* Fixed malformed `ibexa.persistence.legacy.dsn` parameter value

* Moved loading default Core settings to prepend stage

* [Tests] Overridden default storage config for the purpose of tests

---------

Co-Authored-By: Konrad Oboza <[email protected]>
  • Loading branch information
alongosz and konradoboza authored Mar 27, 2024
1 parent 7226b5f commit 0334d52
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1770,11 +1770,6 @@ parameters:
count: 1
path: src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

-
message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\DependencyInjection\\\\IbexaCoreExtension\\:\\:handleDefaultSettingsLoading\\(\\) has no return type specified\\.$#"
count: 1
path: src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

-
message: "#^Method Ibexa\\\\Bundle\\\\Core\\\\DependencyInjection\\\\IbexaCoreExtension\\:\\:handleHelpers\\(\\) has no return type specified\\.$#"
count: 1
Expand Down
23 changes: 8 additions & 15 deletions src/bundle/Core/DependencyInjection/IbexaCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('routing/js_routing.yml');
}

// Default settings
$this->handleDefaultSettingsLoading($container, $loader);

$this->registerRepositoriesConfiguration($config, $container);
$this->registerSiteAccessConfiguration($config, $container);
$this->registerImageMagickConfiguration($config, $container);
Expand Down Expand Up @@ -198,6 +195,9 @@ public function prepend(ContainerBuilder $container)
$this->prependDoctrineConfiguration($container);
$this->prependJMSTranslation($container);

// Default settings
$this->handleDefaultSettingsLoading($container);

$this->configureGenericSetup($container);
$this->configurePlatformShSetup($container);
}
Expand Down Expand Up @@ -236,15 +236,14 @@ private function getMainRepositoryConfigParser(): RepositoryConfigParserInterfac
}

/**
* Handle default settings.
*
* @param \Symfony\Component\DependencyInjection\ContainerBuilder $container
* @param \Symfony\Component\DependencyInjection\Loader\FileLoader $loader
*
* @throws \Exception
*/
private function handleDefaultSettingsLoading(ContainerBuilder $container, FileLoader $loader)
private function handleDefaultSettingsLoading(ContainerBuilder $container): void
{
$loader = new Loader\YamlFileLoader(
$container,
new FileLocator(__DIR__ . '/../Resources/config')
);
$loader->load('default_settings.yml');

foreach ($this->defaultSettingsCollection as $fileLocation => $files) {
Expand Down Expand Up @@ -831,12 +830,6 @@ private function configurePlatformShSetup(ContainerBuilder $container): void
{
$projectDir = $container->getParameter('kernel.project_dir');

// Run for all hooks, incl build step
if ($_SERVER['PLATFORM_PROJECT_ENTROPY'] ?? false) {
// Disable PHPStormPass as we don't have write access & it's not localhost
$container->setParameter('ezdesign.phpstorm.enabled', false);
}

// Will not be executed on build step
$relationships = $_SERVER['PLATFORM_RELATIONSHIPS'] ?? false;
if (!$relationships) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Resources/settings/settings.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
parameters:
ibexa.persistence.legacy.dsn: sqlite://:memory:
ibexa.persistence.legacy.dsn: 'sqlite://:memory:'
anonymous_user_id: 10
kernel.debug: false
languages: []
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/Core/Resources/settings/override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ parameters:
- ger-DE

ibexa.spi.persistence.cache.inmemory.ttl: 0
ibexa.io.dir.storage: var/ibexa_demo_site/storage
ibexa.url_prefix: var/ibexa_demo_site/storage
ibexa.legacy.url_prefix: var/ibexa_demo_site/storage

0 comments on commit 0334d52

Please sign in to comment.