]> _ Git - fluidbook-toolbox.git/commitdiff
wait #4209 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 1 Sep 2022 16:16:35 +0000 (18:16 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 1 Sep 2022 16:16:35 +0000 (18:16 +0200)
.docker/docker-compose.yml
app/Fields/NSISLocale.php
app/Http/Controllers/Admin/Operations/FluidbookPublication/CompositionOperation.php
app/Jobs/FluidbookCompiler.php
app/Models/FluidbookTranslate.php
app/Models/Traits/FluidbookPlayerBranches.php
config/cache.php

index 7ee9d6a643a83595756ed3ac5abee2c83d6ecef4..31fb94b951b259ffce67face2950eeb8ab955dab 100644 (file)
@@ -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'
index b8cb8e416ff2fd9ccf073868527099720bd4e5ef..162b698e636966049808fed2c939bd76380954dd 100644 (file)
@@ -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());
index 192aa738f3a7ec4bdeba7f0a9511d42a79ea2d73..d92522e086dc0659731dea79b663df39fb40de29 100644 (file)
@@ -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, '');
index bbc3e3f0f35121b5a9c16becc5a37fd9b506cce7..1663c7a1edbfba67520cfbfb6400b502dc22fe1a 100644 (file)
@@ -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"></iframe></noscript>
             $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"></iframe></noscript>
         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
index a9c11655d30c930728ac0163e367e91a0ae9572b..c5bef99a7466478822338d766e55358fc48f4ccd 100644 (file)
@@ -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()
index c30ba919f25308855f7262dc728229356de0a892..132abf3862ce4351cfe8f79674aac1e2c85b71e5 100644 (file)
@@ -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;
index 845cd8f737a86e7fbe20950a3a20151c6de4e246..40001634237574a6c9cabde461d093cf268478b7 100644 (file)
@@ -49,7 +49,7 @@ return [
 
         'file' => [
             'driver' => 'file',
-            'path' => storage_path('framework/cache'),
+            'path' => storage_path('framework'),
         ],
 
         'memcached' => [