Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / modules / contrib / migrate_plus / src / Plugin / migrate_plus / data_parser / Soap.php
index 60db902046d7c65622d61ef3f5be1cac5277badd..7f8c694e2f5b7a6038ef08ebd96537e91b1c4999 100755 (executable)
@@ -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;