You are here

public function EntireSiteSourcePlugin::getObject in Backup and Migrate 8.4

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

Get the Backup and Migrate plugin object.

Return value

BackupMigrate\Core\Plugin\PluginInterface;

Overrides WrapperPluginBase::getObject

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

File

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

Class

EntireSiteSourcePlugin
Defines an default database source plugin.

Namespace

Drupal\backup_migrate\Plugin\BackupMigrateSource

Code

public function getObject() {

  // Add the default database.
  $info = \Drupal\Core\Database\Database::getConnectionInfo('default', 'default');
  $info = $info['default'];
  if ($info['driver'] == 'mysql') {
    $conf = $this
      ->getConfig();
    $conf
      ->set('directory', DRUPAL_ROOT);
    $this->db_source = new DrupalMySQLiSource(new Config($info));
    return new DrupalSiteArchiveSource($conf, $this->db_source);
  }
  return NULL;
}