mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 21:43:18 +00:00
CS
This commit is contained in:
@@ -10,15 +10,15 @@
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Service\TaskManager;
|
||||
|
||||
use Alchemy\Phrasea\Core;
|
||||
use Alchemy\Phrasea\Core\Service;
|
||||
use Alchemy\Phrasea\Core\Service\ServiceAbstract;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
use Symfony\Bridge\Monolog\Logger;
|
||||
|
||||
use Monolog\Handler\SyslogHandler;
|
||||
use Monolog\Handler\NativeMailerHandler;
|
||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -124,7 +124,7 @@ class module_console_taskrun extends Command
|
||||
|
||||
if(($ttyloglevel = strtoupper($input->getOption('ttyloglevel'))) != '') {
|
||||
if (!array_key_exists($ttyloglevel, $lib2v)) {
|
||||
throw(new RuntimeException(sprintf(
|
||||
throw(new Alchemy\Phrasea\Exception\RuntimeException(sprintf(
|
||||
"Bad value '%s' for option loglevel\nuse DEBUG|INFO|WARNING|ERROR|CRITICAL|ALERT", $ttyloglevel))
|
||||
);
|
||||
}
|
||||
|
@@ -2132,54 +2132,6 @@ class task_period_archive extends task_abstract
|
||||
return $metas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merge two bags of metadatas indexed by **FieldNames**
|
||||
* Return a bag indexed by **FieldNames**
|
||||
*
|
||||
* @param \databox_descriptionStructure $metadatasStructure The databox structure related
|
||||
* @param MetadataBag $bag1 The first metadata bag
|
||||
* @param MetadataBag $bag2 The second metadata bag
|
||||
* @return \PHPExiftool\Driver\Metadata\MetadataBag
|
||||
*/
|
||||
protected function mergeForDatabox(\databox_descriptionStructure $metadatasStructure, MetadataBag $bag1, MetadataBag $bag2)
|
||||
{
|
||||
$metadatasBag = new MetadataBag();
|
||||
|
||||
foreach ($metadatasStructure as $databox_field) {
|
||||
|
||||
$value = array();
|
||||
|
||||
$tag = $databox_field->get_tag();
|
||||
|
||||
foreach (array($bag1, $bag2) as $bag) {
|
||||
|
||||
if (!$bag->containsKey($databox_field->get_name())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($databox_field->is_multi()) {
|
||||
$value = array_unique(array_merge($value, $bag->get($databox_field->get_name())->getValue()->asArray()));
|
||||
} else {
|
||||
$value = $bag->get($databox_field->get_name())->getValue()->asString();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$value) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($databox_field->is_multi()) {
|
||||
$value = new \PHPExiftool\Driver\Value\Multi($value);
|
||||
} else {
|
||||
$value = new \PHPExiftool\Driver\Value\Mono($value);
|
||||
}
|
||||
|
||||
$metadatasBag->set($databox_field->get_name(), new PHPExiftool\Driver\Metadata\Metadata($tag, $value));
|
||||
}
|
||||
|
||||
return $metadatasBag;
|
||||
}
|
||||
|
||||
protected function readXMLForDatabox(\databox_descriptionStructure $metadatasStructure, $pathfile)
|
||||
{
|
||||
if (false === $this->dependencyContainer['filesystem']->exists($pathfile)) {
|
||||
|
Reference in New Issue
Block a user