-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathBackup.php
22 lines (21 loc) · 906 Bytes
/
Backup.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
namespace FreePBX\modules\Cel;
use FreePBX\modules\Backup as Base;
class Backup Extends Base\BackupBase{
public function runBackup($id,$transaction){
$backupDetails = $this->FreePBX->Backup->getAll($id);
if (isset($backupDetails['celStartDate']) && isset($backupDetails['celEndDate'])) {
$startDate = $backupDetails['celStartDate'];
$endDate = $backupDetails['celEndDate'];
$query = 'eventtime between "' . $startDate . '" and "' . $endDate . '"';
$dumpOtherOptions[] = "--where='" . $query . "'";
}
$dumpOtherOptions[] = '--opt --skip-lock-tables --skip-triggers --no-create-info --default-character-set=utf8mb4';
$dumpOtherOptions = implode(" ", $dumpOtherOptions);
$fileObj = $this->dumpTableIntoFile('cel', 'cel', $dumpOtherOptions, true);
$this->addDirectories([$fileObj->getPath()]);
$this->addConfigs([
'settings' => $this->dumpAdvancedSettings()
]);
}
}