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

* WIP/POC DO NOT MERGE use "pusher" to wait for export-by-email worker to tell client that export is done. nb: export worker is artificially delayed by 30s ! * WIP OK TO TEST ; DO NOT MERGE * WIP/POC DO NOT MERGE use "pusher" to wait for export-by-email worker to tell client that export is done. nb: export worker is artificially delayed by 30s ! * WIP OK TO TEST ; DO NOT MERGE * cleanup * cleanup * better conf & cleanup * fix typo * fix stamp transparency (bump imagine) fix missing cgu for one file download better cli feedback add (re)download link on cli * fix test * fix missing js feedback (when worker publish before client subscribes) * cleanup * fix "remove stamp" choice * add default conf * WIP/POC DO NOT MERGE use "pusher" to wait for export-by-email worker to tell client that export is done. nb: export worker is artificially delayed by 30s ! * WIP OK TO TEST ; DO NOT MERGE * WIP/POC DO NOT MERGE use "pusher" to wait for export-by-email worker to tell client that export is done. nb: export worker is artificially delayed by 30s ! * WIP OK TO TEST ; DO NOT MERGE * cleanup * cleanup * better conf & cleanup * fix typo * fix stamp transparency (bump imagine) fix missing cgu for one file download better cli feedback add (re)download link on cli * fix test * fix missing js feedback (when worker publish before client subscribes) * cleanup * fix "remove stamp" choice * add default conf * WIP OK TO TEST generates an excel report for async download. define some env-vars for Pusher (todo: fix entrypoint to add during install) * fix xl formating for tabs >1 add env_vars to config build * fix test
70 lines
2.2 KiB
PHP
70 lines
2.2 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\DoDownloadController;
|
|
use Alchemy\Phrasea\ControllerProvider\ControllerProviderTrait;
|
|
use Silex\Application;
|
|
use Silex\ControllerProviderInterface;
|
|
use Silex\ServiceProviderInterface;
|
|
|
|
class DoDownload implements ControllerProviderInterface, ServiceProviderInterface
|
|
{
|
|
use ControllerProviderTrait;
|
|
|
|
public function register(Application $app)
|
|
{
|
|
$app['controller.prod.do-download'] = $app->share(function (PhraseaApplication $app) {
|
|
return (new DoDownloadController($app))
|
|
->setDelivererLocator(new LazyLocator($app, 'phraseanet.file-serve'))
|
|
->setDispatcher($app['dispatcher'])
|
|
->setFileSystemLocator(new LazyLocator($app, 'filesystem'))
|
|
;
|
|
});
|
|
}
|
|
|
|
public function boot(Application $app)
|
|
{
|
|
// no-op
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function connect(Application $app)
|
|
{
|
|
$controllers = $this->createCollection($app);
|
|
|
|
/** @uses DoDownloadController::prepareDownload */
|
|
$controllers->get('/{token}/prepare/', 'controller.prod.do-download:prepareDownload')
|
|
->before($app['middleware.token.converter'])
|
|
->bind('prepare_download')
|
|
->assert('token', '[a-zA-Z0-9]{8,32}');
|
|
|
|
/** @uses DoDownloadController::downloadDocuments */
|
|
$controllers->match('/{token}/get/', 'controller.prod.do-download:downloadDocuments')
|
|
->before($app['middleware.token.converter'])
|
|
->bind('document_download')
|
|
->assert('token', '[a-zA-Z0-9]{8,32}');
|
|
|
|
/** @uses DoDownloadController::downloadExecute */
|
|
$controllers->post('/{token}/execute/', 'controller.prod.do-download:downloadExecute')
|
|
->before($app['middleware.token.converter'])
|
|
->bind('execute_download')
|
|
->assert('token', '[a-zA-Z0-9]{8,32}');
|
|
|
|
return $controllers;
|
|
}
|
|
}
|