MediaWiki master
Wikimedia\Leximorph\Util\XmlLoader Class Reference

XmlLoader. More...

Public Member Functions

 __construct (private readonly LoggerInterface $logger,)
 Initializes the XmlLoader with a logger.
 load (string $filePath, string $context='', bool $allowMissing=false)
 Loads an XML file into a DOMDocument instance.

Detailed Description

XmlLoader.

Provides methods for loading and parsing XML files into DOMDocument.

Since
1.45
Author
Doğu Abaris (abari.nosp@m.s@nu.nosp@m.ll.ne.nosp@m.t)
Note
https://www.gnu.org/copyleft/gpl.html GPL-2.0-or-later

Definition at line 21 of file XmlLoader.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Leximorph\Util\XmlLoader::__construct ( private readonly LoggerInterface $logger)

Initializes the XmlLoader with a logger.

Since
1.45

Definition at line 28 of file XmlLoader.php.

Member Function Documentation

◆ load()

Wikimedia\Leximorph\Util\XmlLoader::load ( string $filePath,
string $context = '',
bool $allowMissing = false )

Loads an XML file into a DOMDocument instance.

Parameters
string$filePathThe path to the XML file.
string$contextA short string to include in log messages.
bool$allowMissingIf true, suppress error logging for missing/unreadable files.
Since
1.45
Returns
?DOMDocument Null on failure.

Definition at line 43 of file XmlLoader.php.


The documentation for this class was generated from the following file: