Recently, I was working on a legacy PHP project that synchronises LDAP teams and users. I found several bugs relating to poor DN “parsing” using regexes and string replacement.
There has to be a better way of doing it, I thought. Alas, there’s not much choice in the PHP ecosystem when it comes to parsing DNs. While there are a few libraries and even PHP’s own `ldap_explode_dn()`, I think they don’t have clean APIs.
So I wrote LDAP DN. It breaks down DNs into RDNs and attributes, supports escaping, allows basic manipulation and has 100% test coverage.
I charge regular clients (the ones that I do some work for every month) by the hour.
I use a spreadsheet to track my time.
Less regular clients, I estimate the project and bill them a fixed amount.
Shameless plug: For estimating projects I use a web app I built (https://estipad.com). It lets me break projects down into tasks and subtasks and estimate those instead of the whole project. It also generates a PDF that can go straight to the client.
https://i.imgur.com/Ef1UpCv.png