class EntireSiteSourcePlugin in Backup and Migrate 5.0.x
Same name and namespace in other branches
- 8.4 src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php \Drupal\backup_migrate\Plugin\BackupMigrateSource\EntireSiteSourcePlugin
Defines an default database source plugin.
Plugin annotation
@BackupMigrateSourcePlugin(
id = "EntireSite",
title = @Translation("Entire Site (do not use)"),
description = @Translation("Back up the entire Drupal site. This is not recommended for use on most sites, hopefully it will be fixed in a future release."),
locked = true
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\backup_migrate\Drupal\EntityPlugins\WrapperPluginBase implements WrapperPluginInterface
- class \Drupal\backup_migrate\Drupal\EntityPlugins\SourcePluginBase implements SourcePluginInterface
- class \Drupal\backup_migrate\Plugin\BackupMigrateSource\EntireSiteSourcePlugin
- class \Drupal\backup_migrate\Drupal\EntityPlugins\SourcePluginBase implements SourcePluginInterface
- class \Drupal\backup_migrate\Drupal\EntityPlugins\WrapperPluginBase implements WrapperPluginInterface
Expanded class hierarchy of EntireSiteSourcePlugin
File
- src/
Plugin/ BackupMigrateSource/ EntireSiteSourcePlugin.php, line 22
Namespace
Drupal\backup_migrate\Plugin\BackupMigrateSourceView source
class EntireSiteSourcePlugin extends SourcePluginBase {
protected $dbSource;
/**
* Get the Backup and Migrate plugin object.
*
* @return Drupal\backup_migrate\Core\Plugin\PluginInterface
*/
public function getObject() {
// Add the default database.
$info = Database::getConnectionInfo('default', 'default');
$info = $info['default'];
if ($info['driver'] == 'mysql') {
$conf = $this
->getConfig();
$conf
->set('directory', DRUPAL_ROOT);
$this->dbSource = new DrupalMySQLiSource(new Config($info));
return new DrupalSiteArchiveSource($conf, $this->dbSource);
}
return NULL;
}
/**
* {@inheritdoc}
*/
public function alterBackupMigrate(BackupMigrateInterface $bam, $key, array $options = []) {
if ($source = $this
->getObject()) {
$bam
->sources()
->add($key, $source);
// @todo Enable this, fix it.
// $bam->sources()->add('default_db', $this->dbSource);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntireSiteSourcePlugin:: |
protected | property | ||
EntireSiteSourcePlugin:: |
public | function |
Alter the backup_migrate object to add the source and required services. Overrides SourcePluginBase:: |
|
EntireSiteSourcePlugin:: |
public | function |
Get the Backup and Migrate plugin 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:: |
2 |
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 ConfigurableInterface:: |
|
WrapperPluginBase:: |
public | function | Return a Backup and Migrate Config object with the plugin configuration. | |
WrapperPluginBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
WrapperPluginBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
WrapperPluginBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |