Skip to content

Commit

Permalink
IBX-1853: Rebranded services names (#55)
Browse files Browse the repository at this point in the history
* IBX-1853: Manual adjust for existing aliases

* IBX-1853: Renamed old services names

* IBX-1853: Fixed nullable services and xml aliases

* Used imports instead of FQCN

* Fixed unit tests
  • Loading branch information
ViniTou authored Jan 20, 2022
1 parent f75c329 commit c174136
Show file tree
Hide file tree
Showing 191 changed files with 1,895 additions and 1,819 deletions.
2 changes: 1 addition & 1 deletion src/bundle/Core/ApiLoader/CacheFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* Class CacheFactory.
*
* Service "ezpublish.cache_pool", selects a Symfony cache service based on siteaccess[-group] setting "cache_service_name"
* Service "ibexa.cache_pool", selects a Symfony cache service based on siteaccess[-group] setting "cache_service_name"
*/
class CacheFactory implements ContainerAwareInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Core/ApiLoader/RepositoryFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function __construct(
/**
* Builds the main repository, heart of eZ Publish API.
*
* This always returns the true inner Repository, please depend on ezpublish.api.repository and not this method
* This always returns the true inner Repository, please depend on ibexa.api.repository and not this method
* directly to make sure you get an instance wrapped inside Event / Cache / * functionality.
*/
public function buildRepository(
Expand All @@ -92,7 +92,7 @@ public function buildRepository(
LocationFilteringHandler $locationFilteringHandler,
PasswordValidatorInterface $passwordValidator
): Repository {
$config = $this->container->get('ezpublish.api.repository_configuration_provider')->getRepositoryConfig();
$config = $this->container->get(\Ibexa\Bundle\Core\ApiLoader\RepositoryConfigurationProvider::class)->getRepositoryConfig();

return new $this->repositoryClass(
$persistenceHandler,
Expand Down
12 changes: 6 additions & 6 deletions src/bundle/Core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ class Controller extends AbstractController
{
public function getRepository(): Repository
{
return $this->container->get('ezpublish.api.repository');
return $this->container->get('ibexa.api.repository');
}

protected function getConfigResolver(): ConfigResolverInterface
{
return $this->container->get('ezpublish.config.resolver');
return $this->container->get('ibexa.config.resolver');
}

public function getGlobalHelper(): GlobalHelper
{
return $this->container->get('ezpublish.templating.global_helper');
return $this->container->get('ibexa.templating.global_helper');
}

/**
Expand All @@ -46,9 +46,9 @@ public static function getSubscribedServices(): array
return array_merge(
parent::getSubscribedServices(),
[
'ezpublish.api.repository' => Repository::class,
'ezpublish.config.resolver' => ConfigResolverInterface::class,
'ezpublish.templating.global_helper' => GlobalHelper::class,
'ibexa.api.repository' => Repository::class,
'ibexa.config.resolver' => ConfigResolverInterface::class,
'ibexa.templating.global_helper' => GlobalHelper::class,
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Core\FieldType\BinaryFile\BinaryFileStorage;
use Ibexa\Core\FieldType\Media\MediaStorage;
use Ibexa\Core\MVC\Symfony\FieldType\BinaryBase\ContentDownloadUrlGenerator;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -17,14 +20,14 @@ class BinaryContentDownloadPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
if (!$container->has('ezpublish.fieldType.ezbinarybase.download_url_generator')) {
if (!$container->has(ContentDownloadUrlGenerator::class)) {
return;
}

$downloadUrlReference = new Reference('ezpublish.fieldType.ezbinarybase.download_url_generator');
$downloadUrlReference = new Reference(ContentDownloadUrlGenerator::class);

$this->addCall($container, $downloadUrlReference, 'ezpublish.fieldType.ezmedia.externalStorage');
$this->addCall($container, $downloadUrlReference, 'ezpublish.fieldType.ezbinaryfile.externalStorage');
$this->addCall($container, $downloadUrlReference, MediaStorage::class);
$this->addCall($container, $downloadUrlReference, BinaryFileStorage::class);
}

private function addCall(ContainerBuilder $container, Reference $reference, $targetServiceName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Core\MVC\Symfony\Routing\ChainRouter;
use Ibexa\Core\MVC\Symfony\SiteAccess;
use Ibexa\Core\MVC\Symfony\SiteAccess\Router;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -20,25 +23,25 @@ class ChainRoutingPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('ezpublish.chain_router')) {
if (!$container->hasDefinition(ChainRouter::class)) {
return;
}

$chainRouter = $container->getDefinition('ezpublish.chain_router');
$chainRouter = $container->getDefinition(ChainRouter::class);

// Enforce default router to be part of the routing chain
// The default router will be given the highest priority so that it will be used by default
if ($container->hasDefinition('router.default')) {
$defaultRouter = $container->getDefinition('router.default');
$defaultRouter->addMethodCall('setSiteAccess', [new Reference('ezpublish.siteaccess')]);
$defaultRouter->addMethodCall('setConfigResolver', [new Reference('ezpublish.config.resolver')]);
$defaultRouter->addMethodCall('setSiteAccess', [new Reference(SiteAccess::class)]);
$defaultRouter->addMethodCall('setConfigResolver', [new Reference('ibexa.config.resolver')]);
$defaultRouter->addMethodCall(
'setNonSiteAccessAwareRoutes',
['%ezpublish.default_router.non_siteaccess_aware_routes%']
);
$defaultRouter->addMethodCall(
'setSiteAccessRouter',
[new Reference('ezpublish.siteaccess_router')]
[new Reference(Router::class)]
);
if (!$defaultRouter->hasTag('router')) {
$defaultRouter->addTag(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Core\MVC\Symfony\FieldType\View\ParameterProviderRegistry;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -24,11 +25,11 @@ class FieldTypeParameterProviderRegistryPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('ezpublish.fieldType.parameterProviderRegistry')) {
if (!$container->hasDefinition(ParameterProviderRegistry::class)) {
return;
}

$parameterProviderRegistryDef = $container->getDefinition('ezpublish.fieldType.parameterProviderRegistry');
$parameterProviderRegistryDef = $container->getDefinition(ParameterProviderRegistry::class);

$serviceTags = $container->findTaggedServiceIds(
self::FIELD_TYPE_PARAMETER_PROVIDER_SERVICE_TAG
Expand Down
8 changes: 5 additions & 3 deletions src/bundle/Core/DependencyInjection/Compiler/FragmentPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\Fragment\DecoratedFragmentRenderer;
use Ibexa\Bundle\Core\Fragment\FragmentListenerFactory;
use Ibexa\Bundle\Core\Fragment\InlineFragmentRenderer;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand All @@ -23,15 +25,15 @@ public function process(ContainerBuilder $container)
if (
!(
$container->hasDefinition('fragment.listener')
&& $container->hasDefinition('ezpublish.decorated_fragment_renderer')
&& $container->hasDefinition(DecoratedFragmentRenderer::class)
)
) {
return null;
}

$fragmentListenerDef = $container->findDefinition('fragment.listener');
$fragmentListenerDef
->setFactory([new Reference('ezpublish.fragment_listener.factory'), 'buildFragmentListener'])
->setFactory([new Reference(FragmentListenerFactory::class), 'buildFragmentListener'])
->addArgument(FragmentListener::class);

// Looping over all fragment renderers to decorate them
Expand All @@ -44,7 +46,7 @@ public function process(ContainerBuilder $container)
$definition->setPublic(false);
$container->setDefinition($renamedId, $definition);

$decoratedDef = new ChildDefinition('ezpublish.decorated_fragment_renderer');
$decoratedDef = new ChildDefinition(DecoratedFragmentRenderer::class);
$decoratedDef->setArguments([new Reference($renamedId)]);
$decoratedDef->setPublic($public);
$decoratedDef->setTags($tags);
Expand Down
6 changes: 3 additions & 3 deletions src/bundle/Core/DependencyInjection/Compiler/ImaginePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function process(ContainerBuilder $container)

$filterConfigDef = $container->findDefinition('liip_imagine.filter.configuration');
$filterConfigDef->setClass(FilterConfiguration::class);
$filterConfigDef->addMethodCall('setConfigResolver', [new Reference('ezpublish.config.resolver')]);
$filterConfigDef->addMethodCall('setConfigResolver', [new Reference('ibexa.config.resolver')]);

if ($container->hasAlias('liip_imagine')) {
$imagineAlias = (string)$container->getAlias('liip_imagine');
Expand All @@ -40,7 +40,7 @@ private function processReduceNoiseFilter(ContainerBuilder $container, $driver)
}

$container->setAlias(
'ezpublish.image_alias.imagine.filter.reduce_noise',
'ibexa.image_alias.imagine.filter.reduce_noise',
new Alias("ezpublish.image_alias.imagine.filter.reduce_noise.$driver")
);
}
Expand All @@ -52,7 +52,7 @@ private function processSwirlFilter(ContainerBuilder $container, $driver)
}

$container->setAlias(
'ezpublish.image_alias.imagine.filter.swirl',
'ibexa.image_alias.imagine.filter.swirl',
new Alias("ezpublish.image_alias.imagine.filter.swirl.$driver")
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\Imagine\PlaceholderProviderRegistry;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -14,7 +15,7 @@
class PlaceholderProviderPass implements CompilerPassInterface
{
public const TAG_NAME = 'ibexa.media.images.placeholder.provider';
public const REGISTRY_DEFINITION_ID = 'ezpublish.image_alias.imagine.placeholder_provider.registry';
public const REGISTRY_DEFINITION_ID = PlaceholderProviderRegistry::class;

public function process(ContainerBuilder $container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Core\QueryType\ArrayQueryTypeRegistry;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -21,7 +22,7 @@ final class QueryTypePass implements CompilerPassInterface

public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('ezpublish.query_type.registry')) {
if (!$container->hasDefinition(ArrayQueryTypeRegistry::class)) {
return;
}

Expand All @@ -38,7 +39,7 @@ public function process(ContainerBuilder $container): void
}
}

$aggregatorDefinition = $container->getDefinition('ezpublish.query_type.registry');
$aggregatorDefinition = $container->getDefinition(ArrayQueryTypeRegistry::class);
$aggregatorDefinition->addMethodCall('addQueryTypes', [$queryTypes]);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\ApiLoader\SearchEngineIndexerFactory;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -25,7 +26,7 @@ class RegisterSearchEngineIndexerPass implements CompilerPassInterface
*
* @var string
*/
protected $factoryId = 'ezpublish.api.search_engine.indexer.factory';
protected $factoryId = SearchEngineIndexerFactory::class;

/**
* Register all found search engine indexers to the SearchEngineIndexerFactory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\ApiLoader\SearchEngineFactory;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -25,7 +26,7 @@ class RegisterSearchEnginePass implements CompilerPassInterface
*
* @var string
*/
protected $factoryId = 'ezpublish.api.search_engine.factory';
protected $factoryId = SearchEngineFactory::class;

/**
* Registers all found search engines to the SearchEngineFactory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\ApiLoader\StorageEngineFactory;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -30,11 +31,11 @@ class RegisterStorageEnginePass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('ezpublish.api.storage_engine.factory')) {
if (!$container->hasDefinition(StorageEngineFactory::class)) {
return;
}

$storageEngineFactoryDef = $container->getDefinition('ezpublish.api.storage_engine.factory');
$storageEngineFactoryDef = $container->getDefinition(StorageEngineFactory::class);
foreach ($container->findTaggedServiceIds(self::STORAGE_ENGINE_TAG) as $serviceId => $attributes) {
foreach ($attributes as $attribute) {
if (!isset($attribute['alias'])) {
Expand Down
5 changes: 3 additions & 2 deletions src/bundle/Core/DependencyInjection/Compiler/SecurityPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Ibexa\Core\MVC\Symfony\Security\Authentication\RememberMeRepositoryAuthenticationProvider;
use Ibexa\Core\MVC\Symfony\Security\Authentication\RepositoryAuthenticationProvider;
use Ibexa\Core\MVC\Symfony\Security\HttpUtils;
use Ibexa\Core\MVC\Symfony\SiteAccess;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand All @@ -31,7 +32,7 @@ public function process(ContainerBuilder $container)
return;
}

$configResolverRef = new Reference('ezpublish.config.resolver');
$configResolverRef = new Reference('ibexa.config.resolver');
$permissionResolverRef = new Reference(PermissionResolver::class);
$userServiceRef = new Reference(UserService::class);

Expand Down Expand Up @@ -75,7 +76,7 @@ public function process(ContainerBuilder $container)
$httpUtilsDef->setClass(HttpUtils::class);
$httpUtilsDef->addMethodCall(
'setSiteAccess',
[new Reference('ezpublish.siteaccess')]
[new Reference(SiteAccess::class)]
);

if (!$container->hasDefinition('security.authentication.success_handler')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class SlugConverterConfigurationPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->has('ezpublish.persistence.slug_converter')) {
if (!$container->has(\Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter::class)) {
return;
}
$slugConverterDefinition = $container->getDefinition('ezpublish.persistence.slug_converter');
$slugConverterDefinition = $container->getDefinition(\Ibexa\Core\Persistence\Legacy\Content\UrlAlias\SlugConverter::class);

$parameterConfiguration = $slugConverterDefinition->getArgument(1);
$semanticConfiguration = $container->getParameter('ezpublish.url_alias.slug_converter');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function process(ContainerBuilder $container)

$container->setAlias(
"ezpublish.api.storage_engine.{$alias}.connection",
'ezpublish.persistence.connection'
'ibexa.persistence.connection'
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace Ibexa\Bundle\Core\DependencyInjection\Compiler;

use Ibexa\Bundle\Core\URLChecker\URLHandlerRegistry;
use LogicException;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand All @@ -21,11 +22,11 @@ class URLHandlerPass implements CompilerPassInterface
*/
public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('ezpublish.url_checker.handler_registry')) {
if (!$container->hasDefinition(URLHandlerRegistry::class)) {
return;
}

$definition = $container->findDefinition('ezpublish.url_checker.handler_registry');
$definition = $container->findDefinition(URLHandlerRegistry::class);
foreach ($container->findTaggedServiceIds('ibexa.url_checker.handler') as $id => $attributes) {
foreach ($attributes as $attribute) {
if (!isset($attribute['scheme'])) {
Expand Down
Loading

0 comments on commit c174136

Please sign in to comment.