You are here

function drush_bakery_add_slave in Bakery Single Sign-On System 8.2

Same name and namespace in other branches
  1. 6.2 bakery.drush.inc \drush_bakery_add_slave()
  2. 7.4 bakery.drush.inc \drush_bakery_add_slave()
  3. 7.2 bakery.drush.inc \drush_bakery_add_slave()
  4. 7.3 bakery.drush.inc \drush_bakery_add_slave()

For adding slave sites.

File

./bakery.drush.inc, line 34
Drush integration for Bakery.

Code

function drush_bakery_add_slave($slave) {

  // @FIXME
  // Could not extract the default value because it is either indeterminate, or
  // not scalar. You'll need to provide a default value in
  // config/install/bakery.settings.yml and config/schema/bakery.schema.yml.
  $config = \Drupal::configFactory()
    ->getEditable('bakery.settings');
  $slaves = $config
    ->get('bakery_slaves');
  $slaves[] = $slave;
  $config
    ->set('bakery_slaves', $slaves)
    ->save();
}