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'
{
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());
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, '');
$this->hybrid = $hybrid;
$this->assets = self::getSourcesPath($this->version);
+ $this->compiledAssets = self::getCompiledSourcesPath($this->version);
$this->phonegap = $phonegap;
$this->standalone = $standalone || $this->phonegap;
$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;
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
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;
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()
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();
$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`;
$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;
'file' => [
'driver' => 'file',
- 'path' => storage_path('framework/cache'),
+ 'path' => storage_path('framework'),
],
'memcached' => [