DestinationBase.php in Backup and Migrate 8.4
File
lib/backup_migrate_core/src/Destination/DestinationBase.php
View source
<?php
namespace BackupMigrate\Core\Destination;
use BackupMigrate\Core\Exception\DestinationNotWritableException;
use BackupMigrate\Core\Plugin\PluginBase;
use BackupMigrate\Core\File\BackupFileInterface;
use BackupMigrate\Core\File\BackupFileReadableInterface;
abstract class DestinationBase extends PluginBase implements ReadableDestinationInterface, WritableDestinationInterface {
public function supportedOps() {
return [];
}
public function saveFile(BackupFileReadableInterface $file) {
$this
->_saveFile($file);
$this
->_saveFileMetadata($file);
}
public function loadFileMetadata(BackupFileInterface $file) {
if (!$file
->getMeta('metadata_loaded')) {
$metadata = $this
->_loadFileMetadataArray($file);
$file
->setMetaMultiple($metadata);
$file
->setMeta('metadata_loaded', TRUE);
}
return $file;
}
public function deleteFile($id) {
return $this
->_deleteFile($id);
}
public function isRemote() {
return FALSE;
}
public function checkWritable() {
throw new DestinationNotWritableException('The specified destination cannot be written to.');
}
protected abstract function _deleteFile($id);
protected abstract function _saveFile(BackupFileReadableInterface $file);
protected abstract function _saveFileMetadata(BackupFileInterface $file);
protected abstract function _loadFileMetadataArray(BackupFileInterface $file);
}