Correzioni su script di release

This commit is contained in:
Dasc3er 2020-11-10 13:07:36 +01:00
parent b36fd0b434
commit 2edfc7c562
2 changed files with 17 additions and 26 deletions

View File

@ -369,18 +369,6 @@ function phpDebugBar() {
.pipe(gulp.dest(config.production + '/php-debugbar')); .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 // Operazioni per la release
function release(done) { function release(done) {
// Impostazione dello zip // Impostazione dello zip
@ -410,18 +398,19 @@ function release(done) {
'!files/**', '!files/**',
'!logs/**', '!logs/**',
'!config.inc.php', '!config.inc.php',
'!update/structure.php',
'!**/*.(lock|phar|log|zip|bak|jar|txt)', '!**/*.(lock|phar|log|zip|bak|jar|txt)',
'!**/~*', '!**/~*',
'!vendor/tecnickcom/tcpdf/examples/*', '!vendor/tecnickcom/tcpdf/examples/**',
'!vendor/tecnickcom/tcpdf/fonts/*', '!vendor/tecnickcom/tcpdf/fonts/*',
'vendor/tecnickcom/tcpdf/fonts/*helvetica*', 'vendor/tecnickcom/tcpdf/fonts/*helvetica*',
'!vendor/mpdf/mpdf/tmp/*', '!vendor/mpdf/mpdf/tmp/*',
'!vendor/mpdf/mpdf/ttfonts/*', '!vendor/mpdf/mpdf/ttfonts/*',
'vendor/mpdf/mpdf/ttfonts/DejaVuinfo.txt', 'vendor/mpdf/mpdf/ttfonts/DejaVuinfo.txt',
'vendor/mpdf/mpdf/ttfonts/DejaVu*Condensed*', 'vendor/mpdf/mpdf/ttfonts/DejaVu*Condensed*',
'!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/*', '!vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/**',
'!vendor/respect/validation/tests/*', '!vendor/respect/validation/tests/**',
'!vendor/willdurand/geocoder/tests/*', '!vendor/willdurand/geocoder/tests/**',
], { ], {
dot: true, dot: true,
}).then(function (files) { }).then(function (files) {
@ -452,16 +441,7 @@ function release(done) {
archive.file('checksum.json', {}); archive.file('checksum.json', {});
// Aggiunta del file per il controllo di integrità del database // Aggiunta del file per il controllo di integrità del database
let exec = ` archive.append(shell.exec('php update/structure.php', {
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, {
silent: true silent: true
}).stdout, { }).stdout, {
name: 'database.json' name: 'database.json'

11
update/structure.php Normal file
View File

@ -0,0 +1,11 @@
<?php
error_reporting(0);
$skip_permissions = true;
include_once __DIR__.'/../core.php';
$info = Update::getDatabaseStructure();
$response = json_encode($info);
echo $response;