Exemplo n.º 1
0
                }
                $handler = new \CultuurNet\UDB3\Monolog\SocketIOEmitterHandler($emitter);
                break;
            default:
                continue 2;
        }
        $handler->setLevel($handler_config['level']);
        $logger->pushHandler($handler);
    }
    return $logger;
});
$app['event_command_bus'] = $app->share(function ($app) {
    $mainCommandBus = new \CultuurNet\UDB3\CommandHandling\SimpleContextAwareCommandBus();
    $commandBus = new \CultuurNet\UDB3\CommandHandling\ResqueCommandBus($mainCommandBus, 'event', $app['command_bus_event_dispatcher']);
    $commandBus->setLogger($app['logger.command_bus']);
    $commandBus->subscribe(new \CultuurNet\UDB3\Event\EventCommandHandler($app['event_repository'], $app['search_service']));
    $eventInfoService = new \CultuurNet\UDB3\EventExport\Format\HTML\Uitpas\EventInfo\CultureFeedEventInfoService($app['uitpas'], new \CultuurNet\UDB3\EventExport\Format\HTML\Uitpas\Promotion\EventOrganizerPromotionQueryFactory($app['clock']));
    $eventInfoService->setLogger($app['logger.uitpas']);
    $commandBus->subscribe(new \CultuurNet\UDB3\EventExport\EventExportCommandHandler($app['event_export'], $app['config']['prince']['binary'], $eventInfoService, $app['event_calendar_repository']));
    $commandBus->subscribe(new \CultuurNet\UDB3\SavedSearches\SavedSearchesCommandHandler($app['saved_searches_service_factory']));
    $commandBus->subscribe($app['variations.command_handler']);
    return $commandBus;
});
$app['used_labels_memory'] = $app->share(function ($app) {
    return new \CultuurNet\UDB3\UsedLabelsMemory\DefaultUsedLabelsMemoryService(new \CultuurNet\UDB3\UsedLabelsMemory\UsedLabelsMemoryRepository($app['event_store'], $app['event_bus']));
});
$app['event_labeller'] = $app->share(function ($app) {
    return new \CultuurNet\UDB3\Event\DefaultEventLabellerService($app['event_service'], $app['event_command_bus']);
});
$app['event_editor'] = $app->share(function ($app) {
    return new \CultuurNet\UDB3\Event\DefaultEventEditingService($app['event_service'], $app['event_command_bus'], new \Broadway\UuidGenerator\Rfc4122\Version4Generator(), $app['event_repository'], $app['place_service']);
Exemplo n.º 2
0
    $mainCommandBus = new \CultuurNet\UDB3\CommandHandling\SimpleContextAwareCommandBus();
    $commandBus = new \CultuurNet\UDB3\CommandHandling\ResqueCommandBus($mainCommandBus, 'event', $app['command_bus_event_dispatcher']);
    $commandBus->setLogger($app['logger.command_bus']);
    return $commandBus;
};
/**
 * "Event" command bus.
 */
$app['resque_command_bus_factory']('event');
/**
 * Tie command handlers to event command bus.
 */
$app->extend('event_command_bus_out', function (CommandBusInterface $commandBus, Application $app) {
    // The order is important because the label first needs to be created
    // before it can be added.
    $commandBus->subscribe($app[LabelServiceProvider::COMMAND_HANDLER]);
    $commandBus->subscribe(new \CultuurNet\UDB3\Event\EventCommandHandler($app['event_repository'], $app['organizer_repository'], $app[LabelServiceProvider::JSON_READ_REPOSITORY]));
    $commandBus->subscribe(new \CultuurNet\UDB3\SavedSearches\SavedSearchesCommandHandler($app['saved_searches_service_factory']));
    $commandBus->subscribe($app['variations.command_handler']);
    $commandBus->subscribe(new \CultuurNet\UDB3\Place\CommandHandler($app['place_repository'], $app['organizer_repository'], $app[LabelServiceProvider::JSON_READ_REPOSITORY]));
    $commandBus->subscribe((new \CultuurNet\UDB3\Organizer\OrganizerCommandHandler($app['organizer_repository'], $app[LabelServiceProvider::JSON_READ_REPOSITORY]))->withOrganizerRelationService($app['place_organizer_relation_service'])->withOrganizerRelationService($app['event_organizer_relation_service']));
    $commandBus->subscribe(new \CultuurNet\UDB3\Role\CommandHandler($app['real_role_repository']));
    $commandBus->subscribe($app['media_manager']);
    return $commandBus;
});
$app['used_labels_memory'] = $app->share(function ($app) {
    return new \CultuurNet\UDB3\UsedLabelsMemory\DefaultUsedLabelsMemoryService(new \CultuurNet\UDB3\UsedLabelsMemory\UsedLabelsMemoryRepository($app['event_store'], $app['event_bus']));
});
/** Place **/
$app['place_iri_generator'] = $app->share(function ($app) {
    return new CallableIriGenerator(function ($cdbid) use($app) {