mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-11 03:53:13 +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
88 lines
2.9 KiB
PHP
88 lines
2.9 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\ControllerProvider\Prod;
|
|
|
|
use Alchemy\Phrasea\Application as PhraseaApplication;
|
|
use Alchemy\Phrasea\Core\LazyLocator;
|
|
use Alchemy\Phrasea\Controller\Prod\LazaretController;
|
|
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
|
use Silex\Application;
|
|
use Silex\ControllerProviderInterface;
|
|
use Silex\ServiceProviderInterface;
|
|
|
|
class Lazaret implements ControllerProviderInterface, ServiceProviderInterface
|
|
{
|
|
use ControllerProviderTrait;
|
|
|
|
public function register(Application $app)
|
|
{
|
|
$app['controller.prod.lazaret'] = $app->share(function (PhraseaApplication $app) {
|
|
return (new LazaretController($app))
|
|
->setDataboxLoggerLocator($app['phraseanet.logger'])
|
|
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
|
|
->setEntityManagerLocator(new LazyLocator($app, 'orm.em'))
|
|
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
|
->setSubDefinitionSubstituerLocator(new LazyLocator($app, 'subdef.substituer'))
|
|
;
|
|
});
|
|
}
|
|
|
|
public function boot(Application $app)
|
|
{
|
|
// no-op
|
|
}
|
|
|
|
/**
|
|
* Connect the ControllerCollection to the Silex Application
|
|
*
|
|
* @param Application $app A silex application
|
|
* @return \Silex\ControllerCollection
|
|
*/
|
|
public function connect(Application $app)
|
|
{
|
|
$controllers = $this->createAuthenticatedCollection($app);
|
|
$firewall = $this->getFirewall($app);
|
|
|
|
$controllers->before(function () use ($firewall) {
|
|
$firewall->requireRight(\ACL::CANADDRECORD);
|
|
});
|
|
|
|
$controllers->get('/', 'controller.prod.lazaret:listElement')
|
|
->bind('lazaret_elements');
|
|
|
|
$controllers->get('/{file_id}/', 'controller.prod.lazaret:getElement')
|
|
->assert('file_id', '\d+')
|
|
->bind('lazaret_element');
|
|
|
|
$controllers->post('/{file_id}/force-add/', 'controller.prod.lazaret:addElement')
|
|
->assert('file_id', '\d+')
|
|
->bind('lazaret_force_add');
|
|
|
|
$controllers->post('/{file_id}/deny/', 'controller.prod.lazaret:denyElement')
|
|
->assert('file_id', '\d+')
|
|
->bind('lazaret_deny_element');
|
|
|
|
$controllers->post('/empty/', 'controller.prod.lazaret:emptyLazaret')
|
|
->bind('lazaret_empty');
|
|
|
|
$controllers->post('/{file_id}/accept/', 'controller.prod.lazaret:acceptElement')
|
|
->assert('file_id', '\d+')
|
|
->bind('lazaret_accept');
|
|
|
|
$controllers->get('/{file_id}/thumbnail/', 'controller.prod.lazaret:thumbnailElement')
|
|
->assert('file_id', '\d+')
|
|
->bind('lazaret_thumbnail');
|
|
|
|
return $controllers;
|
|
}
|
|
}
|