From: Vincent Vanwaelscappel Date: Thu, 1 Sep 2022 16:16:35 +0000 (+0200) Subject: wait #4209 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=938a3b555280ba47668442a9848cb94332003c62;p=fluidbook-toolbox.git wait #4209 @1 --- diff --git a/.docker/docker-compose.yml b/.docker/docker-compose.yml index 7ee9d6a64..31fb94b95 100644 --- a/.docker/docker-compose.yml +++ b/.docker/docker-compose.yml @@ -6,6 +6,7 @@ services: working_dir: /application volumes: - '/data1/extranet/toolbox/:/application/' + - '/mnt/sshfs/godzilla/data/fluidbook/docs/:/data1/extranet/www/fluidbook/docs/' - '/data1/extranet/toolbox/storage/app/public/:/usr/local/apache2/htdocs/storage/' - '/data1/extranet/toolbox/public/:/usr/local/apache2/htdocs/' - '/data1/extranet/toolbox/.docker/config/httpd/httpd.conf:/usr/local/apache2/conf/httpd.conf' diff --git a/app/Fields/NSISLocale.php b/app/Fields/NSISLocale.php index b8cb8e416..162b698e6 100644 --- a/app/Fields/NSISLocale.php +++ b/app/Fields/NSISLocale.php @@ -9,7 +9,7 @@ class NSISLocale extends SelectFromArray { public function getOptions() { - $path = '/usr/share/nsis/Contrib/Language\ files/'; + $path = '/usr/local/share/nsis/Contrib/Language\ files/'; $res = []; foreach (File::files($path) as $file) { $e = explode('.', $file->getFilename()); diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/CompositionOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/CompositionOperation.php index 192aa738f..d92522e08 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/CompositionOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/CompositionOperation.php @@ -27,7 +27,7 @@ trait CompositionOperation protected function getThumb($doc_id, $doc_page) { - Session::save(); + /** @var FluidbookDocument $doc */ $doc = FluidbookDocument::find($doc_id); $path = $doc->getFile($doc_page, 'jpg', 'thumb', true, true, ''); diff --git a/app/Jobs/FluidbookCompiler.php b/app/Jobs/FluidbookCompiler.php index bbc3e3f0f..1663c7a1e 100644 --- a/app/Jobs/FluidbookCompiler.php +++ b/app/Jobs/FluidbookCompiler.php @@ -297,6 +297,7 @@ class FluidbookCompiler extends Base implements CompilerInterface $this->hybrid = $hybrid; $this->assets = self::getSourcesPath($this->version); + $this->compiledAssets = self::getCompiledSourcesPath($this->version); $this->phonegap = $phonegap; $this->standalone = $standalone || $this->phonegap; @@ -2711,7 +2712,7 @@ height="0" width="0" style="display:none;visibility:hidden"> $finals['widget'] = $this->widgetJsFiles; } - $dirminimized = Files::mkdir($this->assets . '/js/min'); + $dirminimized = Files::mkdir($this->compiledAssets . '/js/min'); foreach ($finals as $jsfinal => $files) { $mintime = 0; @@ -3966,18 +3967,26 @@ height="0" width="0" style="display:none;visibility:hidden"> return $versions; } - public static function getSourcesPath($version) + public static function getSourcesPath($version, $dir = null) { - $base = self::getFluidbookPlayerBaseDirectory(); - + $res = self::getFluidbookPlayerBaseDirectory(); + if (null !== $dir) { + $res .= $dir . '/'; + } if ($version === 'stable') { - return $base . 'branches/master'; + $res .= 'branches/master'; } else if ($version === 'dev') { - return $base . 'local/master'; + $res .= 'local/master'; } else { list($branch, $location) = explode('|', $version); - return $base . ($location === 'git' ? 'branches' : $location) . '/' . $branch; + $res .= ($location === 'git' ? 'branches' : $location) . '/' . $branch; } + return $res; + } + + public static function getCompiledSourcesPath($version) + { + return self::getSourcesPath($version, 'compiled'); } public function source_path($path = ''): string diff --git a/app/Models/FluidbookTranslate.php b/app/Models/FluidbookTranslate.php index a9c11655d..c5bef99a7 100644 --- a/app/Models/FluidbookTranslate.php +++ b/app/Models/FluidbookTranslate.php @@ -7,12 +7,15 @@ use App\Fields\NSISLocale; use App\Http\Controllers\Admin\Base\FluidbookTranslateController; use App\Http\Controllers\Admin\Operations\FluidbookTranslate\ExcelExportOperation; use App\Http\Controllers\Admin\Operations\FluidbookTranslate\ExcelImportOperation; +use App\Models\Traits\FluidbookPlayerBranches; use Cubist\Backpack\Facades\App; use Cubist\Backpack\Magic\Models\Translate; use Cubist\Util\PHP; class FluidbookTranslate extends Translate { + use FluidbookPlayerBranches; + protected $table = 'fluidbook_translate'; protected static $_allTranslations = null; @@ -46,7 +49,14 @@ class FluidbookTranslate extends Translate public function getPaths() { - return [__('Player') => 'resources/fluidbookpublication/player/branches', __('En cours de développement') => 'resources/fluidbookpublication/player/local'/*, __('Compilateur') => 'resources/compiler', __('Application') => 'resources/html5app'*/]; + $res = []; + foreach (self::getActiveBranches() as $branch) { + $res['Player - git:' . $branch] = 'resources/fluidbookpublication/player/branches/' . $branch . '/js'; + $res['Player - local:' . $branch] = 'resources/fluidbookpublication/player/local/' . $branch . '/js'; + } + //$res[__('Compilateur')]='resources/compiler'; + //$res[__('Application')]=''resources/html5app'; + return $res; } public function getExtensions() diff --git a/app/Models/Traits/FluidbookPlayerBranches.php b/app/Models/Traits/FluidbookPlayerBranches.php index c30ba919f..132abf386 100644 --- a/app/Models/Traits/FluidbookPlayerBranches.php +++ b/app/Models/Traits/FluidbookPlayerBranches.php @@ -43,14 +43,15 @@ trait FluidbookPlayerBranches return json_decode(file_get_contents($cacheFile)); } + protected static function reposDirectory(){ + return self::getFluidbookPlayerBaseDirectory().'repos/fluidbook-html5'; + } + protected function fluidbookCreateBranch($branch) { - $playerDir = self::getFluidbookPlayerBaseDirectory(); - $this->updateAllBranches(); - $branchesDir = $playerDir . 'branches/'; - $dir = $branchesDir . 'fluidbook-html5'; + $dir = self::reposDirectory(); $this->executeGitCommands($dir, ['checkout -b ' . $branch, 'push --set-upstream origin ' . $branch]); $this->updateAllBranches(); @@ -67,7 +68,7 @@ trait FluidbookPlayerBranches $localDir = $playerDir . 'local/'; $this->updateAllBranches(); - $this->executeGitCommand($branchesDir . 'fluidbook-html5', 'push --delete origin ' . $branch); + $this->executeGitCommand(self::reposDirectory(), 'push --delete origin ' . $branch); `rm -rf $localDir$branch`; `rm -rf $branchesDir$branch`; @@ -85,11 +86,11 @@ trait FluidbookPlayerBranches $playerDir = self::getFluidbookPlayerBaseDirectory(); $branchesDir = Files::mkdir($playerDir . 'branches/'); $localDir = Files::mkdir($playerDir . 'local/'); - $baseBranchDir = Files::mkdir($branchesDir . 'fluidbook-html5'); + $repos = self::reposDirectory(); - $this->executeGitCommands($baseBranchDir, ['stash save --keep-index', 'stash drop', 'pull --all', 'fetch --all --prune']); + $this->executeGitCommands($repos, ['stash save --keep-index', 'stash drop', 'pull --all', 'fetch --all --prune']); - $git = new Git($baseBranchDir); + $git = new Git($repos); $branches = $git->listBranches(); foreach ($branches as $b) { $gitsource = $branchesDir . $b; diff --git a/config/cache.php b/config/cache.php index 845cd8f73..400016342 100644 --- a/config/cache.php +++ b/config/cache.php @@ -49,7 +49,7 @@ return [ 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache'), + 'path' => storage_path('framework'), ], 'memcached' => [