Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ManifestDocument.php

function ManifestDocument::fromString

2 calls to ManifestDocument::fromString()
ManifestDocument::fromFile in vendor/phar-io/manifest/src/xml/ManifestDocument.php
ManifestLoader::fromString in vendor/phar-io/manifest/src/ManifestLoader.php

File

vendor/phar-io/manifest/src/xml/ManifestDocument.php, line 42

Class

ManifestDocument

Namespace

PharIo\Manifest

Code

public static function fromString(string $xmlString) : ManifestDocument {
    $prev = libxml_use_internal_errors(true);
    libxml_clear_errors();
    try {
        $dom = new DOMDocument();
        $dom->loadXML($xmlString);
        $errors = libxml_get_errors();
        libxml_use_internal_errors($prev);
    } catch (Throwable $t) {
        throw new ManifestDocumentException($t->getMessage(), 0, $t);
    }
    if (count($errors) !== 0) {
        throw new ManifestDocumentLoadingException($errors);
    }
    return new self($dom);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal