Permalink
Browse files

fixed copyBackupToExternalStorage errors (#4262)

  • Loading branch information...
DawoudIO authored and crossan007 committed Apr 27, 2018
1 parent a42ba14 commit 3363010dbf5e448379c0babb6272998c9fc8dfa0
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/ChurchCRM/Service/SystemService.php
@@ -180,11 +180,11 @@ public function getDatabaseBackup($params)
public static function copyBackupToExternalStorage()
{
$params = new \stdClass();
$params->iArchiveType = 3;
if (strcasecmp(SystemConfig::getValue('sExternalBackupType'), 'WebDAV') == 0) {
if (SystemConfig::getValue('sExternalBackupUsername') && SystemConfig::getValue('sExternalBackupPassword') && SystemConfig::getValue('sExternalBackupEndpoint')) {
$params = new \stdClass();
$params->iArchiveType = 3;
$backup = $this->getDatabaseBackup($params);
$backup = self::getDatabaseBackup($params);
$backup->credentials = SystemConfig::getValue('sExternalBackupUsername') . ':' . SystemConfig::getValue('sExternalBackupPassword');
$backup->filesize = filesize($backup->saveTo);
$fh = fopen($backup->saveTo, 'r');
@@ -204,7 +204,7 @@ public static function copyBackupToExternalStorage()
}
} elseif (strcasecmp(SystemConfig::getValue('sExternalBackupType'), 'Local') == 0) {
try {
$backup = $this->getDatabaseBackup($params);
$backup = self::getDatabaseBackup($params);
exec('mv ' . $backup->saveTo . ' ' . SystemConfig::getValue('sExternalBackupEndpoint'));
return $backup;

0 comments on commit 3363010

Please sign in to comment.