Refresh & delete collections Async - synchronization

This commit is contained in:
fbsanchez 2021-06-14 14:54:07 +02:00
parent a7c1c49636
commit 4db0f75763
2 changed files with 11 additions and 12 deletions

View File

@ -98,7 +98,9 @@ if (empty($apiPassword) === true
&& (enterprise_hook('metaconsole_validate_origin', [get_parameter('server_auth')]) === true
|| enterprise_hook('console_validate_origin', [get_parameter('server_auth')]) === true)
) {
// Allow internal direct node -> metaconsole connection.
// Allow internal direct node -> metaconsole connection
// or node -> own console connection.
$config['__internal_call'] = true;
$config['id_usuario'] = 'admin';
// Compat.
$config['id_user'] = 'admin';

View File

@ -55,6 +55,10 @@ class Files
(\ZipArchive::CREATE | \ZipArchive::OVERWRITE)
);
if (substr($path, (strlen($path) - 1), 1) !== '/') {
$path .= '/';
}
$rdi = new \RecursiveDirectoryIterator(
$path
);
@ -70,9 +74,10 @@ class Files
// Get real and relative
// path for current file.
$filePath = $file->getRealPath();
$relativePath = substr(
$filePath,
(strlen($path) + 1)
$relativePath = str_replace(
$path,
'',
$filePath
);
// Add current file to archive.
@ -166,22 +171,14 @@ class Files
$pf = $folder.$pf;
if (is_dir($pf) === true) {
echo $pf.'/'."\n";
// It's a directory.
if (in_array($pf.'/', $exclusions) === false) {
echo ' => borro'."\n";
self::rmrf($pf.'/');
} else {
echo ' => no borro'."\n";
}
} else {
echo $pf."\n";
// It's a file.
if (in_array($pf, $exclusions) === false) {
echo ' => borro'."\n";
unlink($pf);
} else {
echo ' => no borro'."\n";
}
}
}