public function CliService::sync_core_login in CMS Content Sync 2.1.x
Same name and namespace in other branches
- 8 src/Cli/CliService.php \Drupal\cms_content_sync\Cli\CliService::sync_core_login()
- 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 79
Class
Namespace
Drupal\cms_content_sync\CliCode
public function sync_core_login($io) {
$io
->text('Asking all connected Sync Cores to refresh the login to this site...');
$io
->text('Please note that this only works for old v1 Sync Cores.');
$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.');
}