koriym / data-file
Load XML file with XSD validation
Installs: 66 912
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- ext-dom: *
- ext-libxml: *
- ext-simplexml: *
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-03-31 02:07:24 UTC
README
Validate and load the XML file.
Installation
composer require koriym/data-file
Usage
Simple XML load with validation
use Koriym\DataFile\XmlLoad; $xml = (new XmlLoad())('/path/to/xml', '/path/to/xsd'); assert($xml instanceof SimpleXMLElement);
Config xml load
use Koriym\DataFile\XmlConfigLoad; $xml = (new XmlConfigLoad('confilg.xml'))('/path/to/config_dir', '/path/to/xsd'); assert($xml instanceof SimpleXMLElement);
Loads the config.xml
or config.xml.dist
of the specified directory.
config.xml
will be loaded first.
It is common to ignore dist files to save them in the repository and not to save the local files.