@@ -504,7 +504,7 @@ public static function deleteBackup($backup_format, $backup_password, $backup_di
504504 if ($ success ) {
505505 $ sql = "DELETE FROM web_backup WHERE server_id = ? AND parent_domain_id = ? AND filename = ? " ;
506506 $ app ->db ->query ($ sql , $ server_id , $ domain_id , $ filename );
507- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
507+ if ($ app ->running_on_slaveserver () )
508508 $ app ->dbmaster ->query ($ sql , $ server_id , $ domain_id , $ filename );
509509 $ app ->log ($ sql . ' - ' . json_encode ([$ server_id , $ domain_id , $ filename ]), LOGLEVEL_DEBUG );
510510 }
@@ -1126,7 +1126,7 @@ protected static function clearBackups($server_id, $web_id, $max_backup_copies,
11261126 $ password = NULL ;
11271127
11281128 $ db_list = array ($ app ->db );
1129- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
1129+ if ($ app ->running_on_slaveserver () )
11301130 array_push ($ db_list , $ app ->dbmaster );
11311131
11321132 if ($ backup_mode == "userzip " || $ backup_mode == "rootgz " ) {
@@ -1256,7 +1256,7 @@ protected static function backups_garbage_collection($server_id, $backup_type =
12561256 }
12571257
12581258 $ db_list = array ($ app ->db );
1259- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
1259+ if ($ app ->running_on_slaveserver () )
12601260 array_push ($ db_list , $ app ->dbmaster );
12611261
12621262 // Cleanup web_backup entries for non-existent backup files
@@ -1776,7 +1776,7 @@ protected static function make_database_backup($web_domain, $backup_job)
17761776 //* password is for `Encrypted` column informative purposes, on download password is obtained from web_domain settings
17771777 $ password = $ repos_password ? '*secret* ' : '' ;
17781778 $ app ->db ->query ($ sql , $ server_id , $ domain_id , 'mysql ' , $ backup_mode , $ backup_format_db , time (), $ db_backup_archive , $ archive_size , $ password );
1779- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
1779+ if ($ app ->running_on_slaveserver () )
17801780 $ app ->dbmaster ->query ($ sql , $ server_id , $ domain_id , 'mysql ' , $ backup_mode , $ backup_format_db , time (), $ db_backup_archive , $ archive_size , $ password );
17811781 $ success = true ;
17821782 } else {
@@ -1832,7 +1832,7 @@ protected static function make_database_backup($web_domain, $backup_job)
18321832 //Making compatible with previous versions of ISPConfig:
18331833 $ sql_mode = ($ backup_format_db == 'gzip ' ) ? 'sqlgz ' : ('sql ' . $ backup_format_db );
18341834 $ app ->db ->query ($ sql , $ server_id , $ domain_id , 'mysql ' , $ sql_mode , $ backup_format_db , time (), $ db_compressed_file , $ file_size , $ password );
1835- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
1835+ if ($ app ->running_on_slaveserver () )
18361836 $ app ->dbmaster ->query ($ sql , $ server_id , $ domain_id , 'mysql ' , $ sql_mode , $ backup_format_db , time (), $ db_compressed_file , $ file_size , $ password );
18371837 $ success = true ;
18381838 }
@@ -1982,7 +1982,7 @@ protected static function make_web_backup($web_domain, $backup_job)
19821982 $ sql = "INSERT INTO web_backup (server_id, parent_domain_id, backup_type, backup_mode, backup_format, tstamp, filename, filesize, backup_password) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) " ;
19831983 $ backup_time = time ();
19841984 $ app ->db ->query ($ sql , $ server_id , $ web_id , 'web ' , $ backup_mode , $ backup_format_web , $ backup_time , $ web_backup_archive , $ archive_size , $ password );
1985- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
1985+ if ($ app ->running_on_slaveserver () )
19861986 $ app ->dbmaster ->query ($ sql , $ server_id , $ web_id , 'web ' , $ backup_mode , $ backup_format_web , $ backup_time , $ web_backup_archive , $ archive_size , $ password );
19871987 unset($ archive_size );
19881988 $ app ->log ('Backup of web files for domain ' . $ web_domain ['domain ' ] . ' completed successfully to archive ' . $ full_archive_path , LOGLEVEL_DEBUG );
@@ -2004,7 +2004,7 @@ protected static function make_web_backup($web_domain, $backup_job)
20042004 $ file_size = filesize ($ full_filename );
20052005 $ sql = "INSERT INTO web_backup (server_id, parent_domain_id, backup_type, backup_mode, backup_format, tstamp, filename, filesize, backup_password) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) " ;
20062006 $ app ->db ->query ($ sql , $ server_id , $ web_id , 'web ' , $ backup_mode , $ backup_format_web , time (), $ web_backup_file , $ file_size , $ password );
2007- if ($ app ->db -> dbHost != $ app -> dbmaster -> dbHost )
2007+ if ($ app ->running_on_slaveserver () )
20082008 $ app ->dbmaster ->query ($ sql , $ server_id , $ web_id , 'web ' , $ backup_mode , $ backup_format_web , time (), $ web_backup_file , $ file_size , $ password );
20092009 unset($ file_size );
20102010 $ app ->log ('Backup of web files for domain ' . $ web_domain ['domain ' ] . ' completed successfully to file ' . $ full_filename , LOGLEVEL_DEBUG );
0 commit comments