FIX Solve backup when using mysqldump that return warning

This commit is contained in:
Laurent Destailleur 2016-10-22 16:18:28 +02:00
parent c44aa8f4d7
commit 629af89986
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Dolibarr
Upstream-Contact: Laurent Destailleur <eldy@users.sourceforge.net>
Source: http://www.dolibarr.org/files/stable/standard/
Source: https://www.dolibarr.org/files/stable/standard/
Files: *
Copyright: 2002-2009, Rodolphe Quiedeville <rodolphe@quiedeville.org>

View File

@ -268,7 +268,8 @@ class Utils
{
$i++; // output line number
$read = fgets($handlein);
if ($i == 1 && preg_match('/'.preg_quote('Warning: Using a password').'/i', $read)) continue;
// Exclude warning line we don't want
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;