class DrupalFilesSourcePlugin in Backup and Migrate 8.4
Same name and namespace in other branches
- 5.0.x src/Plugin/BackupMigrateSource/DrupalFilesSourcePlugin.php \Drupal\backup_migrate\Plugin\BackupMigrateSource\DrupalFilesSourcePlugin
Defines an default database source plugin.
Plugin annotation
@BackupMigrateSourcePlugin(
id = "DrupalFiles",
title = @Translation("Public Files"),
description = @Translation("Back up the Drupal public files."),
wrapped_class = "\BackupMigrate\Core\Source\FileDirectorySource",
locked = true
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \BackupMigrate\Drupal\EntityPlugins\WrapperPluginBase implements WrapperPluginInterface
- class \BackupMigrate\Drupal\EntityPlugins\SourcePluginBase implements SourcePluginInterface
- class \Drupal\backup_migrate\Plugin\BackupMigrateSource\DrupalFilesSourcePlugin
- class \BackupMigrate\Drupal\EntityPlugins\SourcePluginBase implements SourcePluginInterface
- class \BackupMigrate\Drupal\EntityPlugins\WrapperPluginBase implements WrapperPluginInterface
Expanded class hierarchy of DrupalFilesSourcePlugin
File
- src/
Plugin/ BackupMigrateSource/ DrupalFilesSourcePlugin.php, line 22
Namespace
Drupal\backup_migrate\Plugin\BackupMigrateSourceView source
class DrupalFilesSourcePlugin extends SourcePluginBase {
/**
* {@inheritdoc}
*/
public function __construct(array $configuration, $plugin_id, $plugin_definition) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
}
/**
* {@inheritdoc}
*/
public function alterBackupMigrate(BackupMigrateInterface $bam, $key, $options = []) {
$source = $this
->getObject();
$bam
->sources()
->add($key, $source);
$config = [
'exclude_filepaths' => [],
'source' => $source,
];
switch ($this
->getConfig()
->get('directory')) {
case 'public://':
$config['exclude_filepaths'] = [
'js',
'css',
'php',
'styles',
'config_*',
'.htaccess',
];
break;
case 'private://':
$config['exclude_filepaths'] = [
'backup_migrate',
];
break;
}
// @TODO: Allow modules to add their own excluded defaults.
$bam
->plugins()
->add($key . '_exclude', new FileExcludeFilter(new Config($config)));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalFilesSourcePlugin:: |
public | function |
Alter the backup and migrate object to add the source and required services. Overrides SourcePluginBase:: |
|
DrupalFilesSourcePlugin:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides WrapperPluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
WrapperPluginBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
WrapperPluginBase:: |
public | function |
Gets default configuration for this plugin. Overrides ConfigurablePluginInterface:: |
|
WrapperPluginBase:: |
public | function | Return a Backup and Migrate Config object with the plugin configuration. | |
WrapperPluginBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurablePluginInterface:: |
|
WrapperPluginBase:: |
public | function | Get the Backup and Migrate plugin object. | 2 |
WrapperPluginBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurablePluginInterface:: |