sp4tz / abacus-xml-exporter
Generic PHP/Symfony XML exporter for Abacus timesheet imports.
dev-main
2026-05-05 13:54 UTC
Requires
- php: >=8.2
- ext-dom: *
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.0
- symfony/config: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
- symfony/yaml: ^6.4 || ^7.0
Suggests
- symfony/config: Required only if you want to use Symfony configuration loading.
- symfony/http-kernel: Required only if you want to use the Symfony bundle integration.
- symfony/yaml: Useful for YAML configuration in Symfony projects.
This package is auto-updated.
Last update: 2026-05-05 13:57:59 UTC
README
Generic PHP/Symfony XML exporter for Abacus timesheet imports.
The package is designed to stay framework-agnostic. Symfony support is only an optional integration layer.
Basic usage
use Sp4tz\AbacusXmlExporter\Config\ExportConfig; use Sp4tz\AbacusXmlExporter\Config\MappingConfig; use Sp4tz\AbacusXmlExporter\Exporter\AbacusTimesheetExporter; use Sp4tz\AbacusXmlExporter\Mapper\ConfigurableAbacusMapper; use Sp4tz\AbacusXmlExporter\Model\TimesheetEntry; use Sp4tz\AbacusXmlExporter\Validator\TimesheetValidator; use Sp4tz\AbacusXmlExporter\Xml\AbacusXmlBuilder; $config = new ExportConfig( rootNode: 'AbaConnectContainer', recordNode: 'TimeSheet', strict: true, ); $mapping = MappingConfig::fromArray([ 'employee_id' => 'PersonNumber', 'date' => 'Date', 'duration' => 'Hours', 'activity_code' => 'Activity', 'cost_center' => 'CostCenter', 'project_code' => 'Project', 'comment' => 'Text', ]); $exporter = new AbacusTimesheetExporter( new TimesheetValidator(), new ConfigurableAbacusMapper($mapping, $config), new AbacusXmlBuilder(), $config, ); $result = $exporter->export([ new TimesheetEntry( employeeIdentifier: '12345', date: new DateTimeImmutable('2026-05-05'), duration: 7.5, activityCode: 'EXERCICE', costCenter: '1000', projectCode: null, comment: 'Exercice pompier' ), ]); if (!$result->isSuccess()) { var_dump($result->getValidationResult()->getErrors()); } file_put_contents('abacus.xml', $result->getXml());
Symfony configuration example
abacus_xml_exporter: company_id: 'ECAP' root_node: 'AbaConnectContainer' record_node: 'TimeSheet' strict: true encoding: 'UTF-8' date_format: 'Y-m-d' decimal_separator: '.' skip_null_values: true required_fields: - employee_id - date - duration mapping: employee_id: 'PersonNumber' date: 'Date' duration: 'Hours' activity_code: 'Activity' cost_center: 'CostCenter' project_code: 'Project' comment: 'Text'
Philosophy
Your application entities should not be passed directly to the exporter. Create adapters implementing TimesheetEntryInterface.