thapp / xmlconf
Xml configuration utility
Requires
- php: >= 5.3.7
- illuminate/cache: 4.0.*
Requires (Dev)
- mikey179/vfsstream: dev-master
- mockery/mockery: 0.7.2
This package is not auto-updated.
Last update: 2024-11-04 11:44:34 UTC
README
Synopsis
This package lets you easily bootstrap data, objects, or whatever from an xml configuration file. The xml configuration file however must validate against a provided xsd schema.
Installation
Add thapp/xmlconf as a requirement to composer.json:
{ "require": { "thapp/xmlconf": "1.0.*" } }
Then run composer update
or composer install
Next step is to tell laravel to load the serviceprovider. In app/config/app.php
add
// ... 'Thapp\XmlConf\XmlConfServiceProvider' // ...
to the providers
array.
Publish configuration
php artisan config:publish thapp/xmlconfig
Examples
This package provides an example directory that should get you started quickly.
For a first glimpse you may copy the storage/sections/config.xml
that is included with this package to
app/storage/sections/config.xml
.
Next, create a new route. Somethig like this should do:
Route::get('/examples', function () use ($app) { $SectionRepository = new Thapp\XmlConf\Examples\Sections\Repository($app['xmlconf.sections']); var_dump($SectionRepository); });
General
File structure
- Vendor/
- ReaderName/
- Schema/
- readername.xsd
- ReaderNameSimpleXml.php
- ReaderNameConfigReader.php
xml storage structure
- app/
- storage/
- ReaderName/
- config.xml