From 2edfc7c5623017d7589740603973bfb9d6efa16b Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Tue, 10 Nov 2020 13:07:36 +0100 Subject: [PATCH] Correzioni su script di release --- gulpfile.js | 32 ++++++-------------------------- update/structure.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 26 deletions(-) create mode 100644 update/structure.php diff --git a/gulpfile.js b/gulpfile.js index ce113fc77..80ec121eb 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -369,18 +369,6 @@ function phpDebugBar() { .pipe(gulp.dest(config.production + '/php-debugbar')); } -function formatPHPExec(exec) { - let php_exec; - let is_windows = process.platform === "win32"; - if (is_windows) { - php_exec = `php -r "` + exec.split("\n").join("") + `"`; - } else { - php_exec = `php -r '` + exec.split("'").join('"') + `'`; - } - - return php_exec; -} - // Operazioni per la release function release(done) { // Impostazione dello zip @@ -410,18 +398,19 @@ function release(done) { '!files/**', '!logs/**', '!config.inc.php', + '!update/structure.php', '!**/*.(lock|phar|log|zip|bak|jar|txt)', '!**/~*', - '!vendor/tecnickcom/tcpdf/examples/*', + '!vendor/tecnickcom/tcpdf/examples/**', '!vendor/tecnickcom/tcpdf/fonts/*', 'vendor/tecnickcom/tcpdf/fonts/*helvetica*', '!vendor/mpdf/mpdf/tmp/*', '!vendor/mpdf/mpdf/ttfonts/*', 'vendor/mpdf/mpdf/ttfonts/DejaVuinfo.txt', 'vendor/mpdf/mpdf/ttfonts/DejaVu*Condensed*', - '!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/*', - '!vendor/respect/validation/tests/*', - '!vendor/willdurand/geocoder/tests/*', + '!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/**', + '!vendor/respect/validation/tests/**', + '!vendor/willdurand/geocoder/tests/**', ], { dot: true, }).then(function (files) { @@ -452,16 +441,7 @@ function release(done) { archive.file('checksum.json', {}); // Aggiunta del file per il controllo di integrità del database - let exec = ` - error_reporting(0); - $skip_permissions = true; - include_once __DIR__.DIRECTORY_SEPARATOR.'core.php'; - $info = Update::getDatabaseStructure(); - $response = json_encode($info); - echo $response;`; - let php_exec = formatPHPExec(exec); - - archive.append(shell.exec(php_exec, { + archive.append(shell.exec('php update/structure.php', { silent: true }).stdout, { name: 'database.json' diff --git a/update/structure.php b/update/structure.php new file mode 100644 index 000000000..7d5224812 --- /dev/null +++ b/update/structure.php @@ -0,0 +1,11 @@ +