public function AcquiaConnectorCommands::spiSend in Acquia Connector 8
Same name and namespace in other branches
- 8.2 src/Commands/AcquiaConnectorCommands.php \Drupal\acquia_connector\Commands\AcquiaConnectorCommands::spiSend()
- 3.x src/Commands/AcquiaConnectorCommands.php \Drupal\acquia_connector\Commands\AcquiaConnectorCommands::spiSend()
A command to send Acquia SPI data.
@command acquia:connector:spi-send
@usage drush -l <host_uri> acquia:connector:spi-send Sends Acquia SPI data.
File
- src/
Commands/ AcquiaConnectorCommands.php, line 156
Class
- AcquiaConnectorCommands
- A Drush command file.
Namespace
Drupal\acquia_connector\CommandsCode
public function spiSend() {
$config = \Drupal::config('acquia_connector.settings');
$state_site_name = \Drupal::state()
->get('spi.site_name');
$state_site_machine_name = \Drupal::state()
->get('spi.site_machine_name');
// Don't send data if site is blocked or missing components.
if ($config
->get('spi.blocked') || is_null($state_site_name) && is_null($state_site_machine_name)) {
$this->logger
->error('Site is blocked or missing components.');
return;
}
$response = \Drupal::service('acquia_connector.spi')
->sendFullSpi(ACQUIA_CONNECTOR_ACQUIA_SPI_METHOD_DRUSH);
if ($response && isset($response['is_error']) && $response['is_error']) {
$this->logger
->error('Failed to send SPI data.');
}
}