Files
Phraseanet/lib/Alchemy/Phrasea/Core/Provider/PhraseaEventServiceProvider.php
jygaulier a70bf2fc70 PHRAS-1304_AUTO-COMPLETION_MASTER (#2061)
* 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
2017-02-06 18:26:56 +01:00

82 lines
3.4 KiB
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2016 Alchemy
*
* 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\ContentNegotiationSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\CookiesDisablerSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\LogoutSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\MaintenanceSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaLocaleSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\RecordEditSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\SessionManagerSubscriber;
use Alchemy\Phrasea\Record\RecordUpdateSubscriber;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class PhraseaEventServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
$app['phraseanet.logout-subscriber'] = $app->share(function () {
return new LogoutSubscriber();
});
$app['phraseanet.locale-subscriber'] = $app->share(function (Application $app) {
return new PhraseaLocaleSubscriber($app);
});
$app['phraseanet.maintenance-subscriber'] = $app->share(function (Application $app) {
return new MaintenanceSubscriber($app);
});
$app['phraseanet.cookie-disabler-subscriber'] = $app->share(function (Application $app) {
return new CookiesDisablerSubscriber($app);
});
$app['phraseanet.session-manager-subscriber'] = $app->share(function (Application $app) {
return new SessionManagerSubscriber($app);
});
$app['phraseanet.content-negotiation.priorities'] = [
'text/html',
'application/json',
];
$app['phraseanet.content-negotiation.custom_formats'] = [];
$app['phraseanet.content-negotiation-subscriber'] = $app->share(function (Application $app) {
return new ContentNegotiationSubscriber(
$app['negotiator'],
$app['phraseanet.content-negotiation.priorities'],
$app['phraseanet.content-negotiation.custom_formats']
);
});
$app['phraseanet.record-edit-subscriber'] = $app->share(function (Application $app) {
return new RecordEditSubscriber(new LazyLocator($app, 'phraseanet.appbox'));
});
$app['dispatcher'] = $app->share(
$app->extend('dispatcher', function (EventDispatcherInterface $dispatcher, Application $app) {
$dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
$dispatcher->addSubscriber($app['phraseanet.record-edit-subscriber']);
return $dispatcher;
})
);
}
public function boot(Application $app)
{
// Nothing to do
}
}