Add additional formats for schema definitions (JSON, YAML etc.)
martinsotirov opened this issue · 3 comments
I know at the end of the day it doesn't really matter what you use for configuration, as long as it gets the job done, but it would still be nice to have other options for configuring the schema. If I am to include Propel in my next project, I'm gonna have to deal with JSON, YAML and XML config files in the same code base. You can see how this can be confusing for users of my project.
Maybe changing Propel\Generator\Manager\AbstractManager
to depend less on specifically XML would be a good start?
What does everyone think? Does anyone else see a problem with having only XML or code annotations or is it just me?
I'm more than open to such a change. We need to keep #36 of @gossi in mind tho'.
It's actually only https://github.com/propelorm/Propel3/blob/8fe8ee0e2d00c4f0a264067af35a9fc0295d4f3f/src/Propel/Generator/Builder/Util/SchemaReader.php that needs to be abstracted, since we build based on the xml only an internal representation using POPOs.
Well, basically if you can't manage various configuration formats, stop what you are doing, you are in the wrong job.
Apart from that, with the current rewrite (of mostly the models), it might be relatively easy to change the input for the schemareader to what the smyfony config component can read from various formats. Dunno, if it's worth. e.g. documentation must be maintained for various formats, end users might be running into pitfalls of various formats (I think about longer, maybe multiline texts). Although I do like my IDE gives autocomplete, when a DTD file is referenced 😉
Closed via #83
Now Propel supports: xml,yaml, json, php formats (we should write some documentation.....)