Download the PHP package david-solus/reo-openimmo without Composer
On this page you can find all versions of the php package david-solus/reo-openimmo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package reo-openimmo
OpenImmo PHP library
OpenImmo and the OpenImmo logo are registered trademarks of the OpenImmo e.V. Neither is this package an official distribution nor am I associated with this organisation!
This library just wraps the OpenImmo XML format with some PHP7/8 classes.
There is an official library available at http://www.openimmo.de/go.php/p/22/support20.htm which costs 95 EUR excl. VAT and is PHP5 only. To completely convince you, you will only be allowed to see the code after you have paid and they have a no-refund policy.
Important note
This lib is a fork of umajiis project. The properties where reordered in this one.
I am not allowed to include real world xml examples into this distribution package due to license restrictions. Thus, some tests are automatically skipped, if the xml files are not found in the examples directory! Do not be fooled by "Open" in OpenImmo ;-)
Usage
Writing OpenImmo XML
will produce
Nested elements are created just as easy. Classes, properties, constants and parameters are named as corresponding items in the xsd file. They are just converted to camelCase to comply with PHP standards.
will generate
Reading OpenImmo XML
Reading data from xml into a easy-to-use object structure is also pretty straightforward. This example will generate a list of objects (addresses).
Writing JSON (since v0.10)
Although the OpenImmo standard just describes an XML version, there may be cases when you want to generate JSON from the given data. Sadly, there is an issue with custom types, scalar values and JSON serialization in the JMS serializer. Nevertheless it is still possible to write JSON format with the Symfony serializer component.
Generating JSON then works like this:
Possible issues
DateTime format not working
Some tools may generate DateTime values in the xml, which cause errors like
This can be caused by a different precision for the microsecond part (1242974) of this value. As the default PHP precision may be lower that the one of the tool, which the xml was generated with. If this problem occurs with the data you use, you can add a handler, included in this package, to the serializer like this:
Update API classes with a new OpenImmo version
- Install composer package.
- Download OpenImmo files from their website (extract into the example folder). Their license agreement denies redistribution of the xsd file.
php -f generate-api.php
will fill thesrc/API
directory with new classes.composer dumpautoload
to update the autoloading.- Done.
Running tests
composer run phpunit
License and Contribution
GPLv3
As this is OpenSource, you are very welcome to contribute by reporting bugs, improve the code, write tests or whatever you are able to do to improve the project.
If you want to do me a favour, buy me something from my Amazon wishlist.
Thank you!
- Qbus Internetagentur GmbH for your code contribution
All versions of reo-openimmo with dependencies
ext-dom Version *
ext-simplexml Version *
jms/serializer Version ^2.1 || ^3.5
cweagans/composer-patches Version ^1.7 || ^2.0