You are here

public function CliService::sync_core_login in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Cli/CliService.php \Drupal\cms_content_sync\Cli\CliService::sync_core_login()
  2. 2.0.x src/Cli/CliService.php \Drupal\cms_content_sync\Cli\CliService::sync_core_login()

Kindly ask the Sync Core to login again.

Parameters

ICLIIO $io: The CLI service which allows interoperability

Throws

\EdgeBox\SyncCore\Exception\SyncCoreException

File

src/Cli/CliService.php, line 74

Class

CliService

Namespace

Drupal\cms_content_sync\Cli

Code

public function sync_core_login($io) {
  $io
    ->text('Asking all connected Sync Cores to refresh the login to this site...');
  $cores = SyncCoreFactory::getAllSyncCores();
  foreach ($cores as $host => $core) {
    if ($core
      ->getSyndicationService()
      ->refreshAuthentication()) {
      $io
        ->text('SUCCESS login from Sync Core at ' . $host);
    }
    else {
      $io
        ->error('FAILED to login from Sync Core at ' . $host);
    }
  }
  $io
    ->success('Done.');
}