mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 10:34:34 +00:00

* PHRAS-1304_AUTO-COMPLETION_MASTER ported from 4.0 * PHRAS-1304_AUTO-COMPLETION_MASTER fix * PHRAS-1304_AUTO-COMPLETION_MASTER fix * PHRAS-1304_AUTO-COMPLETION_MASTER bump php version to 5.5.31 (5.5.21 is obsolete in cicleci) * PHRAS-1304_AUTO-COMPLETION_MASTER bump php version to 5.5.31 : php.ini moved in circelci * PHRAS-1304_AUTO-COMPLETION_MASTER add zmq & date to php for circleci * PHRAS-1304_AUTO-COMPLETION_MASTER add zmq * PHRAS-1304_AUTO-COMPLETION_MASTER bump amqp * PHRAS-1304_AUTO-COMPLETION_MASTER downgrade amqp to 1.2 to test compilation against old librabbit 0.4 (ubuntu) * PHRAS-1304_AUTO-COMPLETION_MASTER add amqp.so to php.ini, (re)bump amqp to 1.6 * PHRAS-1304_AUTO-COMPLETION_MASTER build rabittmq from git * PHRAS-1304_AUTO-COMPLETION_MASTER build rabittmq from git again * PHRAS-1304_AUTO-COMPLETION_MASTER build rabittmq from git again and again * PHRAS-1304_AUTO-COMPLETION_MASTER fix test on media rotation 600*400 -> 400*599 !!! * PHRAS-1304_AUTO-COMPLETION_MASTER restore facebook sdk to 4.0.1 due to mistake * PHRAS-1304_AUTO-COMPLETION_MASTER deleted unwanted file
58 lines
1.8 KiB
PHP
58 lines
1.8 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of alchemy/pipeline-component.
|
|
*
|
|
* (c) Alchemy <info@alchemy.fr>
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
namespace Alchemy\Phrasea\Core\Provider;
|
|
|
|
use Alchemy\Phrasea\Core\LazyLocator;
|
|
use Alchemy\Phrasea\Core\Event\Subscriber\OrderSubscriber;
|
|
use Alchemy\Phrasea\Model\Entities\Order;
|
|
use Alchemy\Phrasea\Order\ValidationNotifier\MailNotifier;
|
|
use Alchemy\Phrasea\Order\ValidationNotifier\WebhookNotifier;
|
|
use Alchemy\Phrasea\Order\ValidationNotifierRegistry;
|
|
use Silex\Application;
|
|
use Silex\ServiceProviderInterface;
|
|
|
|
class OrderServiceProvider implements ServiceProviderInterface
|
|
{
|
|
|
|
/**
|
|
* Registers services on the given app.
|
|
*
|
|
* This method should only be used to configure services and parameters.
|
|
* It should not get services.
|
|
*/
|
|
public function register(Application $app)
|
|
{
|
|
$app['events.order_subscriber'] = $app->share(function (Application $app) {
|
|
$notifierRegistry = new ValidationNotifierRegistry();
|
|
|
|
$notifierRegistry->registerNotifier(Order::NOTIFY_MAIL, new MailNotifier($app));
|
|
$notifierRegistry->registerNotifier(Order::NOTIFY_WEBHOOK, new WebhookNotifier(
|
|
new LazyLocator($app, 'manipulator.webhook-event')
|
|
));
|
|
|
|
return new OrderSubscriber($app, $notifierRegistry);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstraps the application.
|
|
*
|
|
* This method is called after all services are registered
|
|
* and should be used for "dynamic" configuration (whenever
|
|
* a service must be requested).
|
|
*/
|
|
public function boot(Application $app)
|
|
{
|
|
$app['dispatcher']->addSubscriber($app['events.order_subscriber']);
|
|
}
|
|
}
|