In preparation for some summer projects I cleaned up my PHP & Modernizr-based browser- and feature-detection library, Detector. You can get a taste of what it can do by visiting the feature list page or checking out the RESS template demo. The code and feature-set are essentially where I want them to be for 1.0. I could stand to add proper unit tests and the like. I'll attempt to add them in the near future but my schedule is getting really busy. The highlights for this release include:
- the ability to change the family property for a browser via a request variable. For responsive designs this could mean "desktop" mode. Learn more in the docs.
- Modernizr-based tests can now be run once per-session for those features that need to be tested on a per browser basis but won't change in subsequent requests (e.g. pixel density ratio). Learn more in the docs.
- in general I've tried to DRY up the code & reduce memory footprint
On the face of it it doesn't seem like a whole lot happened. More changes are listed in the CHANGELOG. This release, in my opinion, makes Detector a robust and flexible library that brings PHP developers that much closer to their front-end brethren. Now we can build dynamic, future-friendly applications that can take advantage of browser properties server-side.