2
0
forked from Wavyzz/dolibarr

Compare commits

...

1 Commits
12.0.0 ... 6.0

Author SHA1 Message Date
Laurent Destailleur
5d942c9d1a Fix infinit logs 2022-03-10 15:46:00 +01:00

View File

@@ -292,17 +292,19 @@ class Utils
dol_syslog("Run command ".$fullcommandcrypted); dol_syslog("Run command ".$fullcommandcrypted);
$handlein = popen($fullcommandclear, 'r'); $handlein = popen($fullcommandclear, 'r');
$i=0; $i=0;
while (!feof($handlein)) if ($handlein) {
{ while (!feof($handlein))
$i++; // output line number {
$read = fgets($handlein); $i++; // output line number
// Exclude warning line we don't want $read = fgets($handlein);
if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue; // Exclude warning line we don't want
fwrite($handle,$read); if ($i == 1 && preg_match('/Warning.*Using a password/i', $read)) continue;
if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1; fwrite($handle,$read);
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; if (preg_match('/'.preg_quote('-- Dump completed').'/i',$read)) $ok=1;
elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1;
}
pclose($handlein);
} }
pclose($handlein);
if ($compression == 'none') fclose($handle); if ($compression == 'none') fclose($handle);
if ($compression == 'gz') gzclose($handle); if ($compression == 'gz') gzclose($handle);