Remove phraseanet services, update configuration

This commit is contained in:
Romain Neutron
2013-06-11 11:57:43 +02:00
parent 8ecc97e94e
commit 32c2d6154a
99 changed files with 1545 additions and 5049 deletions

View File

@@ -10,7 +10,6 @@
*/
use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Border\Checker;
/**
*
@@ -55,92 +54,13 @@ class patch_370a9 implements patchInterface
}
/**
* Add new border manager service to services.yml & config.yml configuration files
*
* @param base $appbox
* @param Application $app
*/
public function apply(base $appbox, Application $app)
{
$services = $app['phraseanet.configuration']->getServices();
$app['phraseanet.configuration']->setDefault('border-manager');
if ( ! isset($services['Border'])) {
$services['Border'] = array(
'border_manager' => array(
'type' => 'Border\\BorderManager',
'options' => array(
'enabled' => true,
'checkers' => array(
array(
'type' => 'Checker\\Sha256',
'enabled' => true,
),
array(
'type' => 'Checker\\UUID',
'enabled' => true,
),
array(
'type' => 'Checker\\Colorspace',
'enabled' => false,
'options' => array(
'colorspaces' => array(
Checker\Colorspace::COLORSPACE_CMYK,
Checker\Colorspace::COLORSPACE_GRAYSCALE,
Checker\Colorspace::COLORSPACE_RGB,
)
),
),
array(
'type' => 'Checker\\Dimension',
'enabled' => false,
'options' => array(
'width' => 80,
'height' => 80,
),
),
array(
'type' => 'Checker\\Extension',
'enabled' => false,
'options' => array(
),
),
array(
'type' => 'Checker\\Filename',
'enabled' => false,
'options' => array(
'sensitive' => true,
),
),
array(
'type' => 'Checker\\MediaType',
'enabled' => false,
'options' => array(
'mediatypes' => array(
Checker\MediaType::TYPE_AUDIO,
Checker\MediaType::TYPE_DOCUMENT,
Checker\MediaType::TYPE_FLASH,
Checker\MediaType::TYPE_IMAGE,
Checker\MediaType::TYPE_VIDEO,
)
),
)
)
)
)
);
}
$app['phraseanet.configuration']->setServices($services);
$configs = $app['phraseanet.configuration']->getConfigurations();
foreach (array('prod', 'dev', 'test') as $env) {
if (isset($configs[$env])
&& is_array($configs[$env])
&& ! isset($configs[$env]['border-manager'])) {
$configs[$env]['border-manager'] = 'border_manager';
}
}
$app['phraseanet.configuration']->setConfigurations($configs);
return true;
}
}