[Phpmyadmin-devel] further refactoring of sql.php

Marc Delisle marc at infomarc.info
Mon Jun 24 17:11:36 CEST 2013


Hi Supun,

If you are looking for further ideas about refactoring, I have suggestions.

First, have a look at tbl_select.php, both in the QA_3_5 and the QA_4_0 
branches, and see what kind of high-level calls have been left in this 
refactored script. Everything else went to functions. In this case, Atul 
also OOPed the code, which is only expected from you if you have time, 
as it's not part of your proposal.

All chunks of code having a common goal (see for example the "Bookmark 
add" section) should be extracted to sql.lib.php.

I was pretty sure you were aware of this, as your proposal plans to 
spend 6 weeks x 40 hours on refactoring sql.php.

Second, as discussed previously, your proposal says "The sql.php is a 
very large script and is also one of the central components in 
phpMyAdmin. As it is large it is hard to read and maintain. It needs 
refactoring and better integration with other scripts calling it."

So, all scripts that are including sql.php (for example db_qbe.php) 
should probably be including a library file then call a high-level 
function. Hint: sql.php's main job is to deal with $sql_query.

-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list