Skip to content

Commit

Permalink
Merge pull request #4904 from mhsdesign/task/4878-speedup-test-locally
Browse files Browse the repository at this point in the history
TASK: Allow to disable `projection` or `catchUpHook` in config
  • Loading branch information
kitsunet authored Feb 23, 2024
2 parents 7ed4fea + 02105e3 commit e334436
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,18 @@ private function buildProjectionsFactory(ContentRepositoryId $contentRepositoryI
(isset($contentRepositorySettings['projections']) && is_array($contentRepositorySettings['projections'])) || throw InvalidConfigurationException::fromMessage('Content repository "%s" does not have projections configured, or the value is no array.', $contentRepositoryId->value);
$projectionsFactory = new ProjectionsAndCatchUpHooksFactory();
foreach ($contentRepositorySettings['projections'] as $projectionName => $projectionOptions) {
if ($projectionOptions === null) {
continue;
}
$projectionFactory = $this->objectManager->get($projectionOptions['factoryObjectName']);
if (!$projectionFactory instanceof ProjectionFactoryInterface) {
throw InvalidConfigurationException::fromMessage('Projection factory object name for projection "%s" (content repository "%s") is not an instance of %s but %s.', $projectionName, $contentRepositoryId->value, ProjectionFactoryInterface::class, get_debug_type($projectionFactory));
}
$projectionsFactory->registerFactory($projectionFactory, $projectionOptions['options'] ?? []);
foreach (($projectionOptions['catchUpHooks'] ?? []) as $catchUpHookOptions) {
if ($catchUpHookOptions === null) {
continue;
}
$catchUpHookFactory = $this->objectManager->get($catchUpHookOptions['factoryObjectName']);
if (!$catchUpHookFactory instanceof CatchUpHookFactoryInterface) {
throw InvalidConfigurationException::fromMessage('CatchUpHook factory object name for projection "%s" (content repository "%s") is not an instance of %s but %s', $projectionName, $contentRepositoryId->value, CatchUpHookFactoryInterface::class, get_debug_type($catchUpHookFactory));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php
namespace Neos\ContentRepositoryRegistry\Exception;

use Neos\Flow\Annotations as Flow;
use Neos\ContentRepository\Core\Factory\ContentRepositoryId;

#[Flow\Proxy(false)]
final class InvalidConfigurationException extends \RuntimeException
{

public static function missingPreset(ContentRepositoryId $contentRepositoryId, string $presetName): self
{
return new self(sprintf('The preset "%s" referred to in content repository "%s" does not exist', $presetName, $contentRepositoryId->value), 1650557150);
Expand Down

0 comments on commit e334436

Please sign in to comment.