From 59839b03e768a3022c81aa93f672e529cad41378 Mon Sep 17 00:00:00 2001 From: LOBsTerr <LOBsTerr@645020.no-reply.drupal.org> Date: Mon, 28 Aug 2017 10:23:52 -0600 Subject: [PATCH] Issue #2823380 by LOBsTerr, heddn: SoapClient not found --- composer.json | 4 +++- src/Plugin/migrate_plus/data_parser/Soap.php | 9 ++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b1dbd857..fd0d87a2 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 60db9020..7f8c694e 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; -- GitLab