Skip to content
Snippets Groups Projects
Commit a08fa814 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Better filter to exclude mysqldump warning

parent 762ab060
No related branches found
No related tags found
No related merge requests found
......@@ -198,10 +198,12 @@ if ($what == 'mysql')
$ok=0;
dol_syslog("Run command ".$fullcommandcrypted);
$handlein = popen($fullcommandclear, 'r');
$i=0;
while (!feof($handlein))
{
$i++; // output line number
$read = fgets($handlein);
if (preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
fwrite($handle,$read);
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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment