Tuesday 2 February 2010

Comments in Profiler

I've been having fun debugging a large web application.
Because I havent touched PHP in 8 years (and it's not strictly my job), I need some help from the developers to see what is going on. It's also a large application that has grown into a monster to maintain codewise.

I've proposed therefore, the following change to code.

Each call to SQL is prefixed by a SQL comment block, encasing some common features >

/*
Page : index.php
Function : Menu Drop Downs
Logged In : richard.doering
*/
SELECT MenuItem, MenuLink FROM application.userMenus ORDER BY MenuOrder

The comment will be ignored by the query parser but will still be fully visible in Profiler :)

Hopefully we can get this into a library so a single function passes SQL statements through, but that may be a little way off....

No comments: