Skip to content
Snippets Groups Projects
Commit 59839b03 authored by Nikolay Lobachev's avatar Nikolay Lobachev Committed by Lucas Hedding
Browse files

Issue #2823380 by LOBsTerr, heddn: SoapClient not found

parent 6eaa3eb4
No related branches found
No related tags found
No related merge requests found
......@@ -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"
}
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment