PHP Class Symfony\Component\DependencyInjection\Loader\XmlFileLoader

Author: Fabien Potencier ([email protected])
Inheritance: extends Symfony\Component\DependencyInjection\Loader\FileLoader
显示文件 Open project: symfony/symfony Class Usage Examples

Public Methods

Method Description
convertDomElementToArray ( DOMElement $element ) : array Converts a \DomElement object to a PHP array.
load ( $resource, $type = null )
supports ( $resource, $type = null )
validateSchema ( DOMDocument $dom ) : boolean Validates a documents XML schema.

Private Methods

Method Description
getArgumentsAsPhp ( DOMElement $node, string $name, boolean $lowercase = true ) : mixed Returns arguments as valid php types.
getChildren ( DOMNode $node, mixed $name ) : array Get child elements by name.
loadFromExtensions ( DOMDocument $xml ) Loads from an extension.
parseDefinition ( DOMElement $service, string $file ) : Definition | null Parses an individual Definition.
parseDefinitions ( DOMDocument $xml, string $file ) Parses multiple definitions.
parseFileToDOM ( string $file ) : DOMDocument Parses a XML file to a \DOMDocument.
parseImports ( DOMDocument $xml, string $file ) Parses imports.
parseParameters ( DOMDocument $xml ) Parses parameters.
processAnonymousServices ( DOMDocument $xml, string $file ) Processes anonymous services.
validateAlias ( DOMElement $alias, string $file ) Validates an alias.
validateExtensions ( DOMDocument $dom, string $file ) Validates an extension.

Method Details

convertDomElementToArray() public static method

The following rules applies during the conversion: * Each tag is converted to a key value or an array if there is more than one "value" * The content of a tag is set under a "value" key (bar) if the tag also has some nested tags * The attributes are converted to keys () * The nested-tags are converted to keys (bar)
public static convertDomElementToArray ( DOMElement $element ) : array
$element DOMElement A \DomElement instance
return array A PHP array

load() public method

public load ( $resource, $type = null )

supports() public method

public supports ( $resource, $type = null )

validateSchema() public method

Validates a documents XML schema.
public validateSchema ( DOMDocument $dom ) : boolean
$dom DOMDocument
return boolean