You are here

public function EntireSiteSourcePlugin::getObject in Backup and Migrate 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php \Drupal\backup_migrate\Plugin\BackupMigrateSource\EntireSiteSourcePlugin::getObject()

Get the Backup and Migrate plugin object.

Return value

Drupal\backup_migrate\Core\Plugin\PluginInterface

Overrides WrapperPluginBase::getObject

1 call to EntireSiteSourcePlugin::getObject()
EntireSiteSourcePlugin::alterBackupMigrate in src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php
Alter the backup_migrate object to add the source and required services.

File

src/Plugin/BackupMigrateSource/EntireSiteSourcePlugin.php, line 31

Class

EntireSiteSourcePlugin
Defines an default database source plugin.

Namespace

Drupal\backup_migrate\Plugin\BackupMigrateSource

Code

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;
}