write XML line by line - Printable Version +- GetSimple Support Forum (http://get-simple.info/forums) +-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3) +--- Forum: Developer Discussions (http://get-simple.info/forums/forumdisplay.php?fid=8) +--- Thread: write XML line by line (/showthread.php?tid=7474) |
write XML line by line - almendro - 2015-08-12 Hi everyone, this is my first post. Thanks for this great CMS and the community behind. (english is not my mother language so, please, forget me for my poor spelling) I use GIT for versioning my sites and the problem are the XMLs in one big line, so I decide break it tag by tag. In admin/inc/caching_functions.php, at the end of file after saving the data: Code: $xml->asXML($filem); Now, every change made with de admin panel will write XMLs TAGs separated by lines and can be follow the diffs with GIT or another version control system. I hope this will be useful to somebody. Best. RE: write XML line by line - Angryboy - 2015-08-12 Would you like to also post this as an issue on the GetSimple Github repository? Perhaps even fork the project and make a pull request for the change? RE: write XML line by line - almendro - 2015-08-12 (2015-08-12, 03:45:05)Angryboy Wrote: Would you like to also post this as an issue on the GetSimple Github repository? Perhaps even fork the project and make a pull request for the change? Thanks, I will do soon. RE: write XML line by line - shawn_a - 2015-08-12 You could just use the aftersave hooks to post process it RE: write XML line by line - Angryboy - 2015-08-12 Expanding on what shawn said (if almendro wants to write it as a plugin and publish it to extend): PHP Code: <?php I still think almendro's suggestion is worth making an issue/pull request on (e.g. having a constant in gsconfig.php that enables/disables xml prettifying).
RE: write XML line by line - shawn_a - 2015-08-12 Nope I'll add a filter instead RE: write XML line by line - shawn_a - 2015-08-13 even better Added in to core AND added a filter https://github.com/GetSimpleCMS/GetSimpleCMS/issues/1089 RE: write XML line by line - Angryboy - 2015-08-13 Nicely done! RE: write XML line by line - almendro - 2015-08-13 Wow, this is so fast. Thanks dudes! I'm glad to see this was happened. Best! RE: write XML line by line - almendro - 2015-08-13 (2015-08-13, 04:03:26)shawn_a Wrote: even better an honor to contribute into the CORE! thanks. RE: write XML line by line - shawn_a - 2015-08-13 Thanks for the suggestion, this would have actually saved me a ton of time last week, I had my text editor refreshing and reformatting constantly so i could read a file, was very annoying while i was testing output of something. Always do a backup before testing a beta feature, hopefully it wont break anything but since it modifies all xml it could. Needs testing with entities and utf-8, my tests seemed to be ok so far. |