This commit is contained in:
aynsix
2019-09-26 15:30:59 +04:00
parent 194b0b0f5c
commit 5fc4d85aef
2 changed files with 9 additions and 3 deletions

View File

@@ -88,7 +88,6 @@ use Alchemy\Phrasea\Media\PermalinkMediaResolver;
use Alchemy\Phrasea\Media\TechnicalDataServiceProvider;
use Alchemy\Phrasea\Model\Entities\User;
use Alchemy\QueueProvider\QueueServiceProvider;
use Alchemy\Phrasea\Core\Event\Subscriber\WebhookSubdefEventSubscriber;
use Alchemy\WorkerProvider\WorkerServiceProvider;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use MediaVorus\Media\MediaInterface;
@@ -743,7 +742,6 @@ class Application extends SilexApplication
$dispatcher->addSubscriber(new LazaretSubscriber($app));
$dispatcher->addSubscriber(new ValidationSubscriber($app));
$dispatcher->addSubscriber(new WebhookUserEventSubscriber($app));
$dispatcher->addSubscriber(new WebhookSubdefEventSubscriber($app['manipulator.webhook-event']));
return $dispatcher;
})

View File

@@ -2,6 +2,7 @@
namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Core\Event\Subscriber\WebhookSubdefEventSubscriber;
use Alchemy\Phrasea\Webhook\EventProcessorFactory;
use Alchemy\Phrasea\Webhook\EventProcessorWorker;
use Alchemy\Phrasea\Webhook\WebhookInvoker;
@@ -10,6 +11,7 @@ use Alchemy\Worker\CallableWorkerFactory;
use Alchemy\Worker\TypeBasedWorkerResolver;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class WebhookServiceProvider implements ServiceProviderInterface
{
@@ -69,6 +71,12 @@ class WebhookServiceProvider implements ServiceProviderInterface
public function boot(Application $app)
{
// no-op
$app['dispatcher'] = $app->share(
$app->extend('dispatcher', function (EventDispatcherInterface $dispatcher) use ($app) {
$dispatcher->addSubscriber(new WebhookSubdefEventSubscriber($app['manipulator.webhook-event']));
return $dispatcher;
})
);
}
}