Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions src/bundle/Core/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ public function getConfigTreeBuilder(): TreeBuilder

$rootNode = $treeBuilder->getRootNode();

$rootNode
->children()
->booleanNode('strict_mode')
->info('Enable strict mode. If enabled, certain misconfiguration issues that allowed fallback will throw an exception.')
->defaultValue('%kernel.debug%')
->end()
->end()
;

$this->addRepositoriesSection($rootNode);
$this->addSiteAccessSection($rootNode);
$this->addImageMagickSection($rootNode);
Expand Down
2 changes: 2 additions & 0 deletions src/bundle/Core/DependencyInjection/IbexaCoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@
// Note: this is where the transformation occurs
$config = $this->processConfiguration($configuration, $configs);

$container->setParameter('ibexa.strict_mode', $config['strict_mode'] ?? false);

// Base services and services overrides
$loader->load('services.yml');
// Security services
Expand Down Expand Up @@ -776,7 +778,7 @@
// Cache settings
// If CACHE_POOL env variable is set, check if there is a yml file that needs to be loaded for it
if (($pool = $_SERVER['CACHE_POOL'] ?? false) && file_exists($projectDir . "/config/packages/cache_pool/$pool.yaml")) {
$loader = new Loader\YamlFileLoader($container, new FileLocator($projectDir . '/config/packages/cache_pool'));

Check failure on line 781 in src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "/config/packages/cache_pool" 3 times.

See more on https://sonarcloud.io/project/issues?id=ibexa_core&issues=AZ3YlUL7gDhPS1yj4RX_&open=AZ3YlUL7gDhPS1yj4RX_&pullRequest=702
$loader->load($pool . '.yaml');
}

Expand Down Expand Up @@ -805,7 +807,7 @@
/**
* @throws \Exception
*/
private function configurePlatformShSetup(ContainerBuilder $container): void

Check failure on line 810 in src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Refactor this function to reduce its Cognitive Complexity from 66 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=ibexa_core&issues=AZ3YlUL7gDhPS1yj4RX-&open=AZ3YlUL7gDhPS1yj4RX-&pullRequest=702
{
$projectDir = $container->getParameter('kernel.project_dir');

Expand Down Expand Up @@ -870,7 +872,7 @@
$loader->load('cache.redis.yaml');

$container->setParameter('cache_pool', 'cache.redis');
$container->setParameter('cache_dsn', sprintf('%s:%d', $endpoint['host'], $endpoint['port']) . '?retry_interval=3');

Check failure on line 875 in src/bundle/Core/DependencyInjection/IbexaCoreExtension.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "%s:%d" 5 times.

See more on https://sonarcloud.io/project/issues?id=ibexa_core&issues=AZ3YlUL7gDhPS1yj4RYA&open=AZ3YlUL7gDhPS1yj4RYA&pullRequest=702
}
} elseif (isset($relationships['cache'])) {
// Fallback to memcached if here (deprecated, we will only handle redis here in the future)
Expand Down
Loading