forked from Wavyzz/dolibarr
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af6e95aa79 | ||
|
|
5d942c9d1a | ||
|
|
10e32c056e |
@@ -291,18 +291,20 @@ class Utils
|
||||
$ok=0;
|
||||
dol_syslog("Run command ".$fullcommandcrypted);
|
||||
$handlein = popen($fullcommandclear, 'r');
|
||||
$i=0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/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;
|
||||
if ($handlein) {
|
||||
$i=0;
|
||||
while (!feof($handlein))
|
||||
{
|
||||
$i++; // output line number
|
||||
$read = fgets($handlein);
|
||||
// Exclude warning line we don't want
|
||||
if ($i == 1 && preg_match('/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;
|
||||
}
|
||||
pclose($handlein);
|
||||
}
|
||||
pclose($handlein);
|
||||
|
||||
if ($compression == 'none') fclose($handle);
|
||||
if ($compression == 'gz') gzclose($handle);
|
||||
|
||||
Reference in New Issue
Block a user