Skip to content

Commit

Permalink
IBX-1696: Rebranded Container parameters and Config Resolver namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Feb 1, 2022
1 parent a82944a commit 8e0cc13
Show file tree
Hide file tree
Showing 80 changed files with 467 additions and 467 deletions.
4 changes: 2 additions & 2 deletions src/bundle/Core/Command/DebugConfigResolverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function configure()
'namespace',
null,
InputOption::VALUE_REQUIRED,
'Set a different namespace than the default "ezsettings" used by SiteAccess settings.'
'Set a different namespace than the default "ibexa.site_access.config" used by SiteAccess settings.'
);
$this->setHelp(
<<<EOM
Expand All @@ -72,7 +72,7 @@ public function configure()
By default it will give value depending on the global <comment>--siteaccess[=SITEACCESS]</comment> (default SiteAccess is used if not set).
However, you can also manually set <comment>--scope[=NAME]</comment> yourself if you don't want to affect the SiteAccess
set by the system. You can also override the namespace to get something other than the default "ezsettings" namespace by using
set by the system. You can also override the namespace to get something other than the default "ibexa.site_access.config" namespace by using
the <comment>--namespace[=NS]</comment> option.
NOTE: To see *all* compiled SiteAccess settings, use: <comment>debug:config ibexa [system.default]</comment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function process(ContainerBuilder $container)
$defaultRouter->addMethodCall('setConfigResolver', [new Reference('ibexa.config.resolver')]);
$defaultRouter->addMethodCall(
'setNonSiteAccessAwareRoutes',
['%ezpublish.default_router.non_siteaccess_aware_routes%']
['%ibexa.default_router.non_site_access_aware_routes%']
);
$defaultRouter->addMethodCall(
'setSiteAccessRouter',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use Symfony\Component\DependencyInjection\Reference;

/**
* Configures session handler based on `ezplatform.session.handler_id`
* and `ezplatform.session.save_path`.
* Configures session handler based on `ibexa.session.handler_id`
* and `ibexa.session.save_path`.
*
* This ensures parameters have the highest priority and the configuration
* will be respected with default framework.yaml file.
Expand All @@ -25,12 +25,12 @@ final class SessionConfigurationPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
$handlerId = $container->hasParameter('ezplatform.session.handler_id')
? $container->getParameter('ezplatform.session.handler_id')
$handlerId = $container->hasParameter('ibexa.session.handler_id')
? $container->getParameter('ibexa.session.handler_id')
: null;

$savePath = $container->hasParameter('ezplatform.session.save_path')
? $container->getParameter('ezplatform.session.save_path')
$savePath = $container->hasParameter('ibexa.session.save_path')
? $container->getParameter('ibexa.session.save_path')
: null;

if (null !== $handlerId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function process(ContainerBuilder $container)
$slugConverterDefinition = $container->getDefinition(\Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter::class);

$parameterConfiguration = $slugConverterDefinition->getArgument(1);
$semanticConfiguration = $container->getParameter('ezpublish.url_alias.slug_converter');
$semanticConfiguration = $container->getParameter('ibexa.url_alias.slug_converter');

$mergedConfiguration = $parameterConfiguration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* It will check the different scopes available for a given namespace to find the appropriate parameter.
* To work, the dynamic setting must comply internally to the following name format : "<namespace>.<scope>.parameter.name".
*
* - <namespace> is the namespace for your dynamic setting. Defaults to "ezsettings", but can be anything.
* - <namespace> is the namespace for your dynamic setting. Defaults to "ibexa.site_access.config", but can be anything.
* - <scope> is basically the siteaccess name you want your parameter value to apply to.
* Can also be "global" for a global override.
* Another scope is used internally: "default". This is the generic fallback.
Expand Down Expand Up @@ -273,8 +273,8 @@ private function logTooEarlyLoadedListIfNeeded($paramName)
$serviceName = '??';
$firstService = '??';
$commandName = null;
$resettableServiceIds = $container->getParameter('ezpublish.config_resolver.resettable_services');
$updatableServices = $container->getParameter('ezpublish.config_resolver.updateable_services');
$resettableServiceIds = $container->getParameter('ibexa.config_resolver.resettable_services');
$updatableServices = $container->getParameter('ibexa.config_resolver.updateable_services');

// Lookup trace to find last service being loaded as possible blame for eager loading
// Abort if one of the earlier services is detected to be "safe", aka updatable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn

// session_name setting is deprecated in favor of session.name
$container = $contextualizer->getContainer();
$sessionOptions = $container->hasParameter("ezsettings.$currentScope.session") ? $container->getParameter("ezsettings.$currentScope.session") : [];
$sessionOptions = $container->hasParameter("ibexa.site_access.config.$currentScope.session") ? $container->getParameter("ibexa.site_access.config.$currentScope.session") : [];
if (isset($sessionOptions['name'])) {
$contextualizer->setContextualParameter('session_name', $currentScope, $sessionOptions['name']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ public function postMap(array $config, ContextualizerInterface $contextualizer)
private function addComplexParametersDependencies($parameter, $scope, ContainerBuilder $container)
{
// The complex setting exists in this scope, we don't need to do anything
if ($container->hasParameter("ezsettings.$scope.$parameter")) {
if ($container->hasParameter("ibexa.site_access.config.$scope.$parameter")) {
return;
}
$parameterValue = $container->getParameter("ezsettings.default.$parameter");
$parameterValue = $container->getParameter("ibexa.site_access.config.default.$parameter");

// not complex in this scope
if (!$this->complexSettingParser->containsDynamicSettings($parameterValue)) {
Expand All @@ -121,12 +121,12 @@ private function addComplexParametersDependencies($parameter, $scope, ContainerB
}
$dynamicParameterId = sprintf(
'%s.%s.%s',
$dynamicParameterParts['namespace'] ?: 'ezsettings',
$dynamicParameterParts['namespace'] ?: 'ibexa.site_access.config',
$scope,
$dynamicParameterParts['param']
);
if ($container->hasParameter($dynamicParameterId)) {
$container->setParameter("ezsettings.$scope.$parameter", $parameterValue);
$container->setParameter("ibexa.site_access.config.$scope.$parameter", $parameterValue);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public function preMap(array $config, ContextualizerInterface $contextualizer)
$contextualizer->mapConfigArray('translation_siteaccesses', $config, ContextualizerInterface::UNIQUE);

$container = $contextualizer->getContainer();
if ($container->hasParameter('ezpublish.siteaccesses_by_language')) {
$this->siteAccessesByLanguages = $container->getParameter('ezpublish.siteaccesses_by_language');
if ($container->hasParameter('ibexa.site_access.by_language')) {
$this->siteAccessesByLanguages = $container->getParameter('ibexa.site_access.by_language');
}
}

public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerInterface $contextualizer)
{
$container = $contextualizer->getContainer();
if ($container->hasParameter("ezsettings.$currentScope.languages")) {
$languages = $container->getParameter("ezsettings.$currentScope.languages");
if ($container->hasParameter("ibexa.site_access.config.$currentScope.languages")) {
$languages = $container->getParameter("ibexa.site_access.config.$currentScope.languages");
$mainLanguage = array_shift($languages);
if ($mainLanguage) {
$this->siteAccessesByLanguages[$mainLanguage][] = $currentScope;
Expand All @@ -61,7 +61,7 @@ public function mapConfig(array &$scopeSettings, $currentScope, ContextualizerIn
public function postMap(array $config, ContextualizerInterface $contextualizer)
{
$contextualizer->getContainer()->setParameter(
'ezpublish.siteaccesses_by_language',
'ibexa.site_access.by_language',
$this->siteAccessesByLanguages
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void
->end()
->end()
->scalarNode('default')
->defaultValue('%ezsettings.default.content.field_groups.default%')
->defaultValue('%ibexa.site_access.config.default.content.field_groups.default%')
->end()
->end()
->end();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void
->arrayNode('search')
->children()
->scalarNode('engine')
->defaultValue('%ezpublish.api.search_engine.default%')
->defaultValue('%ibexa.api.search_engine.default%')
->info('The search engine to use')
->end()
->scalarNode('connection')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function addSemanticConfig(NodeBuilder $nodeBuilder): void
->arrayNode('storage')
->children()
->scalarNode('engine')
->defaultValue('%ezpublish.api.storage_engine.default%')
->defaultValue('%ibexa.api.storage_engine.default%')
->info('The storage engine to use')
->end()
->scalarNode('connection')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function setContainer(ContainerInterface $container);
/**
* Injects namespace for internal settings.
* Registered internal settings always have the format <namespace>.<scope>.<parameter_name>
* e.g. ezsettings.default.session.
* e.g. ibexa.site_access.config.default.session.
*
* @param string $namespace
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Supported syntax for dynamic settings: $<paramName>[;<namespace>[;<scope>]]$
*
* The following will work :
* $my_param$ (using default namespace, e.g. ezsettings, with current scope).
* $my_param$ (using default namespace, e.g. ibexa.site_access.config, with current scope).
* $my_param;foo$ (using "foo" as namespace, in current scope).
* $my_param;foo;some_siteaccess$ (using "foo" as namespace, forcing "some_siteaccess scope").
*
Expand Down
Loading

0 comments on commit 8e0cc13

Please sign in to comment.