Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EZP-30646: Reimplemented SignalSlots using EventDispatcher #2682

Merged
merged 3 commits into from
Aug 5, 2019
Merged
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
4 changes: 2 additions & 2 deletions doc/specifications/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ covering all eZ Content Repository functionality, this is where you'll find its

This folder is mainly covering concepts and features of the implementation of the API, found in:
- `eZ\Publish\Core\Repository`: Implementation of business logic of the Repository.
- `eZ\Publish\Core\SignalSlot`: "Signal Slot" implementation of Repository allowing to use slots (listener) for signals
(events) on every call to api that changes data in the repository.
- `eZ\Publish\Core\Event`: "Event" implementation of Repository allowing to use Symfony event listeners and subscribers
for events on every call to api that changes data in the repository.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,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
* directly to make sure you get an instance wrapped inside Signal / Cache / * functionality.
* directly to make sure you get an instance wrapped inside Event / Cache / * functionality.
*
* @param \eZ\Publish\SPI\Persistence\Handler $persistenceHandler
* @param \eZ\Publish\SPI\Search\Handler $searchHandler
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function configure()

Note: This script can potentially run for a very long time.

Due to performance issues the command does not send any Signals.
Due to performance issues the command does not send any Events.

<comment>HTTP cache needs to be cleared manually after executing this command.</comment>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ private function handleApiLoading(ContainerBuilder $container, FileLoader $loade
);
$coreLoader->load('repository.yml');
$coreLoader->load('repository/inner.yml');
$coreLoader->load('repository/signalslot.yml');
$coreLoader->load('repository/event.yml');
$coreLoader->load('repository/siteaccessaware.yml');
$coreLoader->load('fieldtype_external_storages.yml');
$coreLoader->load('fieldtypes.yml');
Expand Down
2 changes: 0 additions & 2 deletions eZ/Bundle/EzPublishCoreBundle/EzPublishCoreBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\LocationViewPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\RouterPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\SecurityPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\SignalSlotPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\SlugConverterConfigurationPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\TranslationCollectorPass;
use eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler\ViewProvidersPass;
Expand Down Expand Up @@ -68,7 +67,6 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new LocalePass());
$container->addCompilerPass(new ContentViewPass());
$container->addCompilerPass(new LocationViewPass());
$container->addCompilerPass(new SignalSlotPass());
$container->addCompilerPass(new RouterPass());
$container->addCompilerPass(new SecurityPass());
$container->addCompilerPass(new FragmentPass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ services:
ezpublish.console.command.regenerate_url_aliases:
class: eZ\Bundle\EzPublishCoreBundle\Command\RegenerateUrlAliasesCommand
arguments:
# intentionally passing inner repository to avoid sending Signals due to performance issues
# intentionally passing inner repository to avoid sending Events due to performance issues
- '@ezpublish.api.inner_repository'
- '@?logger'
tags:
Expand Down
21 changes: 0 additions & 21 deletions eZ/Bundle/EzPublishCoreBundle/Resources/config/papi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ parameters:
ezpublish.api.search_engine.factory.class: eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineFactory
ezpublish.api.search_engine.indexer.factory.class: eZ\Bundle\EzPublishCoreBundle\ApiLoader\SearchEngineIndexerFactory

# Symfony event converter Slot
ezpublish.signalslot.event_converter_slot.class: eZ\Bundle\EzPublishCoreBundle\SignalSlot\Slot\SymfonyEventConverterSlot

# Using legacy storage engine for data compatibility with 4.x
ezpublish.api.storage_engine.default: legacy
ezpublish.api.search_engine.default: legacy
Expand All @@ -18,9 +15,6 @@ parameters:
ezpublish.api.location.class: eZ\Publish\Core\Repository\Values\Content\Location
ezpublish.api.version.class: eZ\Publish\Core\Repository\Values\Content\VersionInfo

# SignalDispatcher factory
ezpublish.signalslot.signal_dispatcher.factory.class: eZ\Bundle\EzPublishCoreBundle\ApiLoader\SignalSlot\SignalDispatcherFactory

services:
# API
ezpublish.api.repository.factory:
Expand Down Expand Up @@ -73,21 +67,6 @@ services:
factory: ["@ezpublish.api.search_engine.indexer.factory", buildSearchEngineIndexer]
public: false

# Signal Slot API wrapper
ezpublish.signalslot.event_converter_slot:
class: "%ezpublish.signalslot.event_converter_slot.class%"
arguments: ["@event_dispatcher"]
tags:
- { name: ezpublish.api.slot, signal: '*' }

# SignalDispatcher Factory
ezpublish.signalslot.signal_dispatcher.factory:
class: "%ezpublish.signalslot.signal_dispatcher.factory.class%"
arguments:
- "%ezpublish.signalslot.signal_dispatcher.class%"
- "$repository$"
- "%ezpublish.repositories%"

# Redefine background indexer to the one provided here which works on kernel/console.terminate.
ezpublish.search.background_indexer:
class: eZ\Bundle\EzPublishCoreBundle\EventListener\BackgroundIndexingTerminateListener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ services:
ezplatform.core.command.cleanup_versions:
class: eZ\Bundle\EzPublishCoreBundle\Command\CleanupVersionsCommand
arguments:
- "@ezpublish.signalslot.repository"
- '@eZ\Publish\Core\Event\Repository'
- "@ezpublish.config.resolver"
- "@ezpublish.persistence.connection"
tags:
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php

/**
* File containing the SignalSlotPassTest class.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*/
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use eZ\Publish\Core\Base\Container\Compiler\Search\Legacy\CriterionFieldValueHandlerRegistryPass;
use eZ\Publish\Core\Base\Container\Compiler\Search\Legacy\SortClauseConverterPass;
use eZ\Publish\Core\Base\Container\Compiler\Search\FieldRegistryPass;
use eZ\Publish\Core\Base\Container\Compiler\Search\SearchEngineSignalSlotPass;

class EzPublishLegacySearchEngineBundle extends Bundle
{
Expand All @@ -26,7 +25,6 @@ public function build(ContainerBuilder $container)
$container->addCompilerPass(new CriterionFieldValueHandlerRegistryPass());
$container->addCompilerPass(new SortClauseConverterPass());
$container->addCompilerPass(new FieldRegistryPass());
$container->addCompilerPass(new SearchEngineSignalSlotPass('legacy'));
}

public function getContainerExtension()
Expand Down
2 changes: 1 addition & 1 deletion eZ/Publish/API/Repository/Tests/ContentServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6672,9 +6672,9 @@ public function testPublishVersionWithSelectedLanguages()
$contentUpdateStruct->setField('name', 'Draft 1 DE', 'ger-DE');

$contentService->updateContent($draft->versionInfo, $contentUpdateStruct);

$contentService->publishVersion($draft->versionInfo, ['ger-DE']);
$content = $contentService->loadContent($draft->contentInfo->id);

$this->assertEquals(
[
'eng-US' => 'Published US',
Expand Down
Loading