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

Breadcrumb

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

function XmlDumper::dump

Dumps the service container as an XML string.

Overrides DumperInterface::dump

File

vendor/symfony/dependency-injection/Dumper/XmlDumper.php, line 40

Class

XmlDumper
XmlDumper dumps a service container as an XML string.

Namespace

Symfony\Component\DependencyInjection\Dumper

Code

public function dump(array $options = []) : string {
    $this->document = new \DOMDocument('1.0', 'utf-8');
    $this->document->formatOutput = true;
    $container = $this->document
        ->createElementNS('http://symfony.com/schema/dic/services', 'container');
    $container->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
    $container->setAttribute('xsi:schemaLocation', 'http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd');
    $this->addParameters($container);
    $this->addServices($container);
    $this->document
        ->appendChild($container);
    $xml = $this->document
        ->saveXML();
    unset($this->document);
    return $this->container
        ->resolveEnvPlaceholders($xml);
}
RSS feed
Powered by Drupal