Hi Mikolaj
Thanks for your very insightful feedback, much appreciated.
I just want to clarify that the proposal I made for the JSON source files is for what I call the "source files". Currently the data I am proposing to convert to JSON is in a set of SQL Server 2000 databases. Currently a script is run that converts these to the .ini files (known just as "the files") that people download and use with libraries.
We absolutely *must* maintain these generated INI files for backwards compatibility. There are many legacy Classic ASP applications that use the unfettered browscap.dll which means we must continue to support. Additionally, this is built into PHP Zend engine as you are aware with get_browser. This however does not stop us considering a slimmer format in the future, but for the time being the focus is on making the generation of the ini files - in their current format - as simple and as open as possible. That includes allowing people to make pull requests on GitHub in an open format - hence my proposal to use JSON as the source format.
What you've suggested is a great idea though and will allow us to simplify source format though, I think I can work something into this, although with limitations, so using PCRE may not really be viable. We need to include strict version constraints in order to generate the INI files, which as you have observed have a block for each version. However, I think we don't have to have a source file for each version, we can just say "this match applies from version x to y" and the match might be like
Mozilla * (My Browser #version#, #render#, #platform#)
And we could use #version# as the version constraint... So in the JSON we might add two properties, "version_from" and "version_to". If a certain browser changed their UA format significantly, we would have to make a new matcher.
You'll notice I added #render# and #platform# - we could use these to reduce any repetition on rendering engine, device and platform matching too - so each of those would add their own matches. This may or may not work, I'll have to investigate further.
The key to making this new source format is that it MUST be able to generate the INI files in their current format.
I'll work on updating the proposal with some of the suggestions you've made, great ideas :)
Exciting!
Thanks
James
That's my plan! The tool I've built is really a prototype, and I've built an "ini diff" command too which compares ini files regardless of the order and "format", so that will help to start with. I still need to put some work into it to get it working properly but the general idea is there so far. I also need to write a script to import the old database to the new JSON format, that should be fun ;)
I'll keep working on it then :) thanks for your feedback Mikolaj.
James
--
You received this message because you are subscribed to the Google Groups "browscap-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to browscap-dev...@googlegroups.com.
To post to this group, send email to browsc...@googlegroups.com.
Visit this group at http://groups.google.com/group/browscap-dev.
The thought did cross my mind - one step at a time though :) iirc, the original database does have a sort of rough ordering pattern, although I have not looked into it too much yet.