1. Go to this page and download the library: Download pandaac/exporter library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pandaac / exporter example snippets
use Exception;
use pandaac\Exporter\Parsers;
use pandaac\Exporter\Exporter;
try {
$exporter = new Exporter('/home/pandaac/theforgottenserver');
$response = $exporter->parse(new Parsers\Weapons);
} catch (Exception $e) {
// Handle exceptions as you see fit...
}
$exporter = new Exporter('/home/pandaac/theforgottenserver', $settings);
$settings = [
'xml' => [
// The XML engine will automatically validate any file it tries to parse,
// and if the data is invalid, an exception will be thrown. You may
// disable this behaviour by setting `validate` to `false`.
'validate' => true,
// The XML engine will not throw exceptions on missing files when
// parsing through a recursive structure. You may enable this
// behaviour by setting `strict` to `true`.
'strict' => false,
],
]
use pandaac\Exporter\Parsers\XMLSource;
use pandaac\Exporter\Sources\StringContent;
$exporter->parse(new XMLSource(
new StringContent('<online><player id="1" /><player id="2" /></online>')
));