Track your time working on PHP projects
For years I hated timesheets. I am not particularly thorough at doing them either, so it just gets worse and worse. Fear not, I think I may have found a neat solution. The idea is to track when a PHP file is executed and log which project it belongs to.
To use my script, just follow the instructions in comments, but basically you will add it as a auto_prepend_file in your php.ini and it will check if the current script is watched and to which project it belongs to.
It is using a very basic file structure without even writing content. It is simply creating folder and files so you should not see the overhead. In fact, I tested that it creates an overhead of only about 0.3ms (on a SSD).
It also has a threshold to count as continuous several minutes without activity (more details in comments).
So lets say you have this structure:
- /var/www/client-A/project-1
- /var/www/client-A/project-2
- /var/www/client-B/project-1
- 2013-01-30
- client-A
- project-1: Time: 3:30
- project-2: Time: 1:30
- client-B
- project-1: Time: 2:00
- 2013-01-31
- client-B
- project-1: Time: 8:30
Downside
Now, of the people I have showed this, a lot have said that it tracks a too narrow portion of site development. From what I am used to, I have to disagree. Here's a breakdown of events that would be tracked:- Looking or configuring the CMS
- Testing some CSS/JS/HTML/PHP
- Testing a new plugin
- An AJAX request that runs on the page
- Developing a complicated library
- Documenting
- Designing