Loading CHANGELOG.md +21 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,27 @@ title: "Changements intervenus sur OSE" author: Laurent Lécluse - DSI - Unicaen --- # OSE 10-zf2 et 10-zf3 (à venir) ## Nouveautés * Possibilité d'utiliser un service Unoconv présent sur un serveur dédié autre que celui de OSE ## Notes de mise à jour Ajout de nouveaux paramètres de configuration pour pouvoir externaliser l'usage du service Unoconv. A ajouter dans votre fichier config.local.php et à personnaliser le cas échéant : ```php /* Génération d'états de sortie avec Unoconv */ 'etats-sortie' => [ /* Serveur où se situe le service Unoconv */ 'host' => '127.0.0.1', // par défaut sur la même machine que OSE /* Répertoire de travail utilisé à la fois par OSE et par le service Unoconv */ 'tmp-dir' => getcwd() . '/cache/', // par défaut dans le répertoire cache de OSE ], ``` # OSE 9.0.2-zf2 et 9.0.2-zf3 ## Correction de bugs Loading config.local.php.default +10 −0 Original line number Diff line number Diff line Loading @@ -241,4 +241,14 @@ return [ 'debug' => false, ], /* Génération d'états de sortie avec Unoconv */ 'etats-sortie' => [ /* Serveur où se situe le service Unoconv */ 'host' => '127.0.0.1', // par défaut sur la même machine que OSE /* Répertoire de travail utilisé à la fois par OSE et par le service Unoconv */ 'tmp-dir' => getcwd() . '/cache/', // par défaut dans le répertoire cache de OSE ], ]; No newline at end of file config/autoload/application.global.php +6 −1 Original line number Diff line number Diff line Loading @@ -34,5 +34,10 @@ return [ 'scheme' => AppConfig::get('global', 'scheme'), 'domain' => AppConfig::get('global', 'domain'), ], 'application' => [ 'etats-sortie' => [ 'host' => AppConfig::get('etats-sortie', 'host', '127.0.0.1'), 'tmp-dir' => AppConfig::get('etats-sortie', 'tmp-dir', getcwd() . '/cache/'), ], ], ]; No newline at end of file module/Application/src/Application/Service/EtatSortieService.php +37 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ class EtatSortieService extends AbstractEntityService { use ParametresServiceAwareTrait; /** * @var array */ private $config; /** Loading Loading @@ -79,7 +84,13 @@ class EtatSortieService extends AbstractEntityService public function genererPdf(EtatSortie $etatSortie, array $filtres, array $options = []): Document { $document = new Document(); $document->setTmpDir(getcwd() . '/cache/'); if (isset($this->config['host'])){ $document->setHost($this->config['host']); } if (isset($this->config['tmp-dir'])){ $document->setTmpDir($this->config['tmp-dir']); } $document->getPublisher()->setAutoBreak($etatSortie->isAutoBreak()); $document->setPdfOutput(true); if ($etatSortie->hasFichier()) { Loading Loading @@ -323,4 +334,29 @@ class EtatSortieService extends AbstractEntityService return $connection->fetchAll($query, $queryFilters); } /** * @return array */ public function getConfig() { return $this->config; } /** * @param array $config * * @return EtatSortieService */ public function setConfig(array $config): EtatSortieService { $this->config = $config; return $this; } } No newline at end of file module/Application/src/Application/Service/Factory/EtatSortieServiceFactory.php +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,12 @@ class EtatSortieServiceFactory $service = new EtatSortieService; $service->setEntityManager($container->get(Constants::BDD)); $config = $container->get('Config'); if (isset($config['application']['etats-sortie'])){ $service->setConfig($config['application']['etats-sortie']); } return $service; } } No newline at end of file Loading
CHANGELOG.md +21 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,27 @@ title: "Changements intervenus sur OSE" author: Laurent Lécluse - DSI - Unicaen --- # OSE 10-zf2 et 10-zf3 (à venir) ## Nouveautés * Possibilité d'utiliser un service Unoconv présent sur un serveur dédié autre que celui de OSE ## Notes de mise à jour Ajout de nouveaux paramètres de configuration pour pouvoir externaliser l'usage du service Unoconv. A ajouter dans votre fichier config.local.php et à personnaliser le cas échéant : ```php /* Génération d'états de sortie avec Unoconv */ 'etats-sortie' => [ /* Serveur où se situe le service Unoconv */ 'host' => '127.0.0.1', // par défaut sur la même machine que OSE /* Répertoire de travail utilisé à la fois par OSE et par le service Unoconv */ 'tmp-dir' => getcwd() . '/cache/', // par défaut dans le répertoire cache de OSE ], ``` # OSE 9.0.2-zf2 et 9.0.2-zf3 ## Correction de bugs Loading
config.local.php.default +10 −0 Original line number Diff line number Diff line Loading @@ -241,4 +241,14 @@ return [ 'debug' => false, ], /* Génération d'états de sortie avec Unoconv */ 'etats-sortie' => [ /* Serveur où se situe le service Unoconv */ 'host' => '127.0.0.1', // par défaut sur la même machine que OSE /* Répertoire de travail utilisé à la fois par OSE et par le service Unoconv */ 'tmp-dir' => getcwd() . '/cache/', // par défaut dans le répertoire cache de OSE ], ]; No newline at end of file
config/autoload/application.global.php +6 −1 Original line number Diff line number Diff line Loading @@ -34,5 +34,10 @@ return [ 'scheme' => AppConfig::get('global', 'scheme'), 'domain' => AppConfig::get('global', 'domain'), ], 'application' => [ 'etats-sortie' => [ 'host' => AppConfig::get('etats-sortie', 'host', '127.0.0.1'), 'tmp-dir' => AppConfig::get('etats-sortie', 'tmp-dir', getcwd() . '/cache/'), ], ], ]; No newline at end of file
module/Application/src/Application/Service/EtatSortieService.php +37 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ class EtatSortieService extends AbstractEntityService { use ParametresServiceAwareTrait; /** * @var array */ private $config; /** Loading Loading @@ -79,7 +84,13 @@ class EtatSortieService extends AbstractEntityService public function genererPdf(EtatSortie $etatSortie, array $filtres, array $options = []): Document { $document = new Document(); $document->setTmpDir(getcwd() . '/cache/'); if (isset($this->config['host'])){ $document->setHost($this->config['host']); } if (isset($this->config['tmp-dir'])){ $document->setTmpDir($this->config['tmp-dir']); } $document->getPublisher()->setAutoBreak($etatSortie->isAutoBreak()); $document->setPdfOutput(true); if ($etatSortie->hasFichier()) { Loading Loading @@ -323,4 +334,29 @@ class EtatSortieService extends AbstractEntityService return $connection->fetchAll($query, $queryFilters); } /** * @return array */ public function getConfig() { return $this->config; } /** * @param array $config * * @return EtatSortieService */ public function setConfig(array $config): EtatSortieService { $this->config = $config; return $this; } } No newline at end of file
module/Application/src/Application/Service/Factory/EtatSortieServiceFactory.php +6 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,12 @@ class EtatSortieServiceFactory $service = new EtatSortieService; $service->setEntityManager($container->get(Constants::BDD)); $config = $container->get('Config'); if (isset($config['application']['etats-sortie'])){ $service->setConfig($config['application']['etats-sortie']); } return $service; } } No newline at end of file