/** * Get the config for a single backup node. * * @param array $json * @throws \phpbu\App\Exception * @return \phpbu\App\Configuration\Backup */ private function getBackupConfig(array $json) { $name = Arr::getValue($json, 'name'); $stopOnFailure = Arr::getValue($json, 'stopOnFailure', false); $backup = new Configuration\Backup($name, $stopOnFailure); $backup->setSource($this->getSource($json)); $backup->setTarget($this->getTarget($json)); $this->setChecks($backup, $json); $this->setCrypt($backup, $json); $this->setSyncs($backup, $json); $this->setCleanup($backup, $json); return $backup; }
/** * Get the config for a single backup node. * * @param \DOMElement $backupNode * @throws \phpbu\App\Exception * @return \phpbu\App\Configuration\Backup */ private function getBackupConfig(DOMElement $backupNode) { $stopOnFailure = Str::toBoolean($backupNode->getAttribute('stopOnFailure'), false); $backupName = $backupNode->getAttribute('name'); $backup = new Configuration\Backup($backupName, $stopOnFailure); $backup->setSource($this->getSource($backupNode)); $backup->setTarget($this->getTarget($backupNode)); $this->setChecks($backup, $backupNode); $this->setCrypt($backup, $backupNode); $this->setSyncs($backup, $backupNode); $this->setCleanup($backup, $backupNode); return $backup; }