From 913a4035d8cdb4021a16f1386f54d22b059774b2 Mon Sep 17 00:00:00 2001 From: sandeep Date: Thu, 22 Mar 2018 17:09:33 +0400 Subject: [PATCH] PHRAS-1375 config xsendfile ne fonctionne plus --- .../Command/Setup/XSendFileMappingGenerator.php | 2 +- lib/Alchemy/Phrasea/Databox/DataboxPathExtractor.php | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php b/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php index fd56a6765b..920c7b0cb4 100644 --- a/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php +++ b/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php @@ -37,7 +37,7 @@ class XSendFileMappingGenerator extends Command protected function doExecute(InputInterface $input, OutputInterface $output) { $extractor = new DataboxPathExtractor($this->container->getApplicationBox()); - $paths = $extractor->extractPaths(); + $paths = $extractor->extractPaths('xsendfile'); foreach ($paths as $path) { $this->container['filesystem']->mkdir($path); } diff --git a/lib/Alchemy/Phrasea/Databox/DataboxPathExtractor.php b/lib/Alchemy/Phrasea/Databox/DataboxPathExtractor.php index f3e4a82e95..89b877ccfb 100644 --- a/lib/Alchemy/Phrasea/Databox/DataboxPathExtractor.php +++ b/lib/Alchemy/Phrasea/Databox/DataboxPathExtractor.php @@ -22,11 +22,19 @@ class DataboxPathExtractor $this->appbox = $appbox; } - public function extractPaths() + /** + * @param string $type + * @return array + */ + public function extractPaths($type = null) { $paths = []; foreach ($this->appbox->get_databoxes() as $databox) { + if ($type === 'xsendfile') { + $paths[] = (string) $databox->get_sxml_structure()->path; + } + foreach ($databox->get_subdef_structure()->getSubdefGroup('video') as $subdef) { $paths[] = $subdef->get_path(); }