From: Vincent Vanwaelscappel Date: Tue, 21 Jan 2025 15:42:29 +0000 (+0100) Subject: wait #7266 @2.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=6de6087d44369c677c8e6879774cfd0f477f7a8a;p=fluidbook-toolbox.git wait #7266 @2.5 --- diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index 8ed2e85d3..5fb35827e 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -3,6 +3,7 @@ namespace App\Fluidbook\Compiler; use App\Fields\FluidbookFont; +use App\Fluidbook\Region; use App\Fluidbook\SEO\Page; use App\Fluidbook\SocialImage; use App\Http\Controllers\Admin\Operations\Tools\Favicon; @@ -13,7 +14,6 @@ use App\Jobs\FluidbookImagesPreprocess; use App\Jobs\QuizDownload; use App\Models\ELearningMedia; use App\Models\ELearningPackage; -use App\Models\File; use App\Models\FluidbookHealthIssues; use App\Models\FluidbookPublication; use App\Models\FluidbookTheme; @@ -343,6 +343,11 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError $this->vdir->setErrorListener($this); $this->wdir = $this->getFluidbook()->getAssetDir(); + if ($this->getFluidbook()->getRegion() === 'US') { + $eu = $this->getFluidbook()->getAssetDir(Region::EUROPE); + $cmd = "cp -a -v -n $eu* $this->wdir"; + `$cmd`; + } $this->widget = false; diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index e132ca6a7..62f814837 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -596,6 +596,11 @@ class FluidbookPublication extends ToolboxStatusModel } } + public function getRegion() + { + return $this->region; + } + public function getFinalPath($theme = null, $scormVariant = false) { $dir = $this->id; @@ -617,9 +622,9 @@ class FluidbookPublication extends ToolboxStatusModel return Files::mkdir($this->protected_path('fluidbookpublication/working/')); } - public function getAssetDir() + public function getAssetDir($forceRegion = null) { - return Files::mkdir($this->protected_path('fluidbookpublication/working/' . $this->getAssetDirId())); + return Files::mkdir($this->protected_path('fluidbookpublication/working/' . $this->getAssetDirId(), $forceRegion)); } public function getPDFDir()