diff --git a/composer.json b/composer.json index b1dbd8570e07f7df13d9538bf653aa39a4160564..fd0d87a2b6e9a5b9b8c1e5126d3caf3b9ce974f0 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,9 @@ "source": "https://cgit.drupalcode.org/migrate_plus" }, "minimum-stability": "dev", - "require": {}, + "require": { + "ext-soap": "*" + }, "suggest": { "sainsburys/guzzle-oauth2-plugin": "3.0 required for the OAuth2 authentication plugin" } diff --git a/src/Plugin/migrate_plus/data_parser/Soap.php b/src/Plugin/migrate_plus/data_parser/Soap.php index 60db902046d7c65622d61ef3f5be1cac5277badd..7f8c694e2f5b7a6038ef08ebd96537e91b1c4999 100755 --- a/src/Plugin/migrate_plus/data_parser/Soap.php +++ b/src/Plugin/migrate_plus/data_parser/Soap.php @@ -3,6 +3,7 @@ namespace Drupal\migrate_plus\Plugin\migrate_plus\data_parser; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; +use Drupal\migrate\Exception\RequirementsException; use Drupal\migrate\MigrateException; use Drupal\migrate_plus\DataParserPluginBase; @@ -46,8 +47,14 @@ class Soap extends DataParserPluginBase implements ContainerFactoryPluginInterfa /** * {@inheritdoc} + * + * @throws \Drupal\migrate\Exception\RequirementsException + * If PHP SOAP extension is not installed. */ public function __construct(array $configuration, $plugin_id, $plugin_definition) { + if (!class_exists('\SoapClient')) { + throw new RequirementsException('The PHP SOAP extension is not installed'); + } parent::__construct($configuration, $plugin_id, $plugin_definition); $this->function = $configuration['function']; $this->parameters = $configuration['parameters']; @@ -63,7 +70,7 @@ class Soap extends DataParserPluginBase implements ContainerFactoryPluginInterfa * If we can't resolve the SOAP function or its response property. */ protected function openSourceUrl($url) { - // Will throw SoapFault if there's + // Will throw SoapFault if there's an error in a SOAP call. $client = new \SoapClient($url); // Determine the response property name. $function_found = FALSE;