From 93767556b874170ff7a5d09b73bf80059d03a063 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 24 Nov 2023 18:39:38 +0100 Subject: [PATCH] wait #6515 --- app/Fluidbook/Compiler/Compiler.php | 9 ++++- app/Models/FluidbookHealthIssues.php | 10 +++++- composer.lock | 50 ++++++++++++++-------------- 3 files changed, 42 insertions(+), 27 deletions(-) diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index cce812972..ad6a186eb 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -22,6 +22,7 @@ use Cubist\Util\ArrayUtil; use Cubist\Util\CommandLine; use Cubist\Util\Data; use Cubist\Util\Files\Files; +use Cubist\Util\Files\IVirtualDirectoryErrorListener; use Cubist\Util\Files\VirtualDirectory; use Cubist\Util\Graphics\Color; use Cubist\Util\Graphics\Image; @@ -36,7 +37,7 @@ use Fluidbook\Tools\SVG\SVGTools; use Illuminate\Console\Command; use SplFileInfo; -class Compiler extends Base implements CompilerInterface +class Compiler extends Base implements CompilerInterface, IVirtualDirectoryErrorListener { use FluidbookPlayerBranches; use \Fluidbook\Tools\Compiler\FluidbookCompiler; @@ -322,6 +323,7 @@ class Compiler extends Base implements CompilerInterface $this->dir = $this->getFluidbook()->getFinalPath($theme, $scormVariant); $this->vdir = new VirtualDirectory($this->dir); + $this->vdir->setErrorListener($this); $this->wdir = $this->getFluidbook()->getAssetDir(); @@ -2516,6 +2518,11 @@ class Compiler extends Base implements CompilerInterface { FluidbookHealthIssues::addIssue($this->book_id, $type, $data); } + + public function handleVirtualDirectoryError($message) + { + $this->addIssue(FluidbookHealthIssues::TYPE_COMPILE_FILES, ['error' => $message]); + } } diff --git a/app/Models/FluidbookHealthIssues.php b/app/Models/FluidbookHealthIssues.php index 36ee0f02b..e3a598818 100644 --- a/app/Models/FluidbookHealthIssues.php +++ b/app/Models/FluidbookHealthIssues.php @@ -15,6 +15,7 @@ class FluidbookHealthIssues extends ToolboxModel const TYPE_QRCODE_NOT_READABLE = 2; const TYPE_MOBILEFIRST_CONFIG = 3; const TYPE_TTS_VOICE_INVALID = 4; + const TYPE_COMPILE_FILES = 5; const CRIT_ERROR = 5; const CRIT_WARNING = 3; @@ -66,7 +67,8 @@ class FluidbookHealthIssues extends ToolboxModel * __('Le chemin ":path" est introuvable') * __('Le QRcode du lien :uid (page :page) n\'a pas pu être décodé') * __('Ce fluidbook mobile first a le paramètre "Identifiant du fluidbook Mobile first" défini. Ce paramètre est réservé aux fluidbooks Desktop') - * __('La voix d\'audiodescription :voice est invalide'); + * __('La voix d\'audiodescription :voice est invalide') + * __('L\'erreur suivante s\'est produite lors de la compilation du fluidbook : :error') * */ return [ @@ -99,6 +101,12 @@ class FluidbookHealthIssues extends ToolboxModel 'criticality' => self::CRIT_ERROR, 'text' => 'La voix d\'audiodescription :voice est invalide', ], + static::TYPE_COMPILE_FILES => + [ + 'summary' => __('Erreur lors de la compilation'), + 'criticality' => self::CRIT_ERROR, + 'text' => 'L\'erreur suivante s\'est produite lors de la compilation du fluidbook : :error', + ], ]; } diff --git a/composer.lock b/composer.lock index 06d44ff43..626168c8f 100644 --- a/composer.lock +++ b/composer.lock @@ -1014,12 +1014,12 @@ "source": { "type": "git", "url": "https://github.com/chillerlan/php-qrcode.git", - "reference": "33ad99a1bd116fa329993b373224e16e5af43f6d" + "reference": "a301af5b7faa7fcd690b29f38b283616a7d93b89" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/33ad99a1bd116fa329993b373224e16e5af43f6d", - "reference": "33ad99a1bd116fa329993b373224e16e5af43f6d", + "url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/a301af5b7faa7fcd690b29f38b283616a7d93b89", + "reference": "a301af5b7faa7fcd690b29f38b283616a7d93b89", "shasum": "" }, "require": { @@ -1101,7 +1101,7 @@ "type": "ko_fi" } ], - "time": "2023-10-29T19:15:03+00:00" + "time": "2023-11-24T15:47:26+00:00" }, { "name": "chillerlan/php-settings-container", @@ -1667,13 +1667,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_cms-back.git", - "reference": "94b795415ede47f1845285682d11a6f8b4461e84" + "reference": "e6206f6514c3d3cc25c6cf7daf04fc886d573c60" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-backpack5-a79f9a.tar", - "reference": "94b795415ede47f1845285682d11a6f8b4461e84", - "shasum": "d2266393869bc7b50a860787e676177da643ae09" + "url": "https://composer.cubedesigners.com/dist/cubist/cms-back/cubist-cms-back-dev-backpack5-e94f8d.tar", + "reference": "e6206f6514c3d3cc25c6cf7daf04fc886d573c60", + "shasum": "c8337ca463d6d03a6b2f2fa203494a0f302f79f9" }, "require": { "backpack/backupmanager": "^v3.0.9", @@ -1752,7 +1752,7 @@ } ], "description": "Cubist Backpack extension", - "time": "2023-11-08T15:57:24+00:00" + "time": "2023-11-24T11:07:55+00:00" }, { "name": "cubist/cms-front", @@ -2050,13 +2050,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_net.git", - "reference": "a67603800a93bde7294c450a99a862d2f51b219a" + "reference": "4a0e6efad661c32c33e66384c221df230e06a040" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/net/cubist-net-dev-master-b429cc.tar", - "reference": "a67603800a93bde7294c450a99a862d2f51b219a", - "shasum": "f2a91449c8b133fc14b1130d4b7c1c55482c6bf0" + "url": "https://composer.cubedesigners.com/dist/cubist/net/cubist-net-dev-master-41040e.tar", + "reference": "4a0e6efad661c32c33e66384c221df230e06a040", + "shasum": "970ac53923bcbbac458216870f8b77ac511913f4" }, "require": { "cubist/util": "dev-master", @@ -2080,7 +2080,7 @@ } ], "description": "net cubist composer package", - "time": "2023-11-07T11:19:05+00:00" + "time": "2023-11-23T16:52:20+00:00" }, { "name": "cubist/pdf", @@ -2175,13 +2175,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_util.git", - "reference": "6bf2e76444fcf1e4071f927cbcba7ae289f5420e" + "reference": "7008756cdf4d2cd69ff309a677730291becd08f6" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-15d837.tar", - "reference": "6bf2e76444fcf1e4071f927cbcba7ae289f5420e", - "shasum": "b9d1e26f3942c7428943d69e761243f03169d2cd" + "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-5589bd.tar", + "reference": "7008756cdf4d2cd69ff309a677730291becd08f6", + "shasum": "d39cfbb10bba5a5c0e18c244da1eac2abe724337" }, "require": { "cubist/net": "dev-master", @@ -2215,7 +2215,7 @@ } ], "description": "Utilities class", - "time": "2023-11-22T12:16:47+00:00" + "time": "2023-11-24T17:02:13+00:00" }, { "name": "cviebrock/eloquent-sluggable", @@ -3835,13 +3835,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "dd9b5b32ddc1a14afce0aed09a39be2723dc8502" + "reference": "9d74b725e456b8912e26e4f630b712929c1ffcce" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-cf70ef.tar", - "reference": "dd9b5b32ddc1a14afce0aed09a39be2723dc8502", - "shasum": "1a3c8493f78e9d5bcad767e5cfb7c6877fec005e" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-e6610a.tar", + "reference": "9d74b725e456b8912e26e4f630b712929c1ffcce", + "shasum": "abb301d693b5224d89704e53160307df206808b9" }, "require": { "barryvdh/laravel-debugbar": "*", @@ -3877,7 +3877,7 @@ } ], "description": "Fluidbook Tools", - "time": "2023-11-17T09:43:44+00:00" + "time": "2023-11-24T15:36:20+00:00" }, { "name": "fruitcake/php-cors", @@ -17306,5 +17306,5 @@ "ext-zlib": "*" }, "platform-dev": [], - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.1.0" } -- 2.39.5