for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the BenGorFile package.
*
* (c) Beñat Espiña <[email protected]>
* (c) Gorka Laucirica <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace BenGorFile\FileBundle\Routing;
use Symfony\Component\Routing\Route;
/**
* Download routes loader.
* @author Beñat Espiña <[email protected]>
class DownloadRoutesLoader extends RoutesLoader
{
* {@inheritdoc}
public function supports($resource, $type = null)
return 'bengor_file_download' === $type;
}
protected function register($file, array $config)
$this->routes->add(
'bengor_file_' . $file . '_download',
new Route(
$config['upload_dir'] . '/{filename}',
[
'_controller' => 'BenGorFileBundle:Download:' . $config['storage'],
'uploadDestination' => $config['upload_destination'],
],
[],
'',
['GET']
)
);