You are here

protected function Xml::openSourceUrl in Migrate Plus 8.3

Same name and namespace in other branches
  1. 8.5 src/Plugin/migrate_plus/data_parser/Xml.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Xml::openSourceUrl()
  2. 8.2 src/Plugin/migrate_plus/data_parser/Xml.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Xml::openSourceUrl()
  3. 8.4 src/Plugin/migrate_plus/data_parser/Xml.php \Drupal\migrate_plus\Plugin\migrate_plus\data_parser\Xml::openSourceUrl()

Opens the specified URL.

Parameters

$url: URL to open.

Return value

bool TRUE if the URL was successfully opened, FALSE otherwise.

Overrides DataParserPluginBase::openSourceUrl

File

src/Plugin/migrate_plus/data_parser/Xml.php, line 174

Class

Xml
Obtain XML data for migration using the XMLReader pull parser.

Namespace

Drupal\migrate_plus\Plugin\migrate_plus\data_parser

Code

protected function openSourceUrl($url) {

  // (Re)open the provided URL.
  $this->reader
    ->close();

  // Clear XML error buffer. Other Drupal code that executed during the
  // migration may have polluted the error buffer and could create false
  // positives in our error check below. We are only concerned with errors
  // that occur from attempting to load the XML string into an object here.
  libxml_clear_errors();
  return $this->reader
    ->open($url, NULL, \LIBXML_NOWARNING);
}