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'));
}
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'

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;