[Phpmyadmin-devel] Goals for GSOC week 5

Marc Delisle marc at infomarc.info
Mon Jul 15 18:43:52 CEST 2013


Le 2013-07-15 11:20, Supun Nakandala a écrit :
> On Mon, Jul 15, 2013 at 8:28 PM, Marc Delisle <marc at infomarc.info
> <mailto:marc at infomarc.info>> wrote:
>
>     Le 2013-07-15 10:44, Supun Nakandala a écrit :
>      > Hi devs,
>      > I am facing a difficulty in setting up the goals for the week 5.
>     I think
>      > I have considerably refactored the sql.php using extract method.
>     I would
>      > like to hear from you whether I should consider further refactoring
>      > using extract method or any other suggestions to work on during
>     the next
>      > week.
>      >
>      > Regards Supun
>
>     Hi Supun,
>
>     Regarding code extraction, I think we are fine. However, here is what I
>     told you on June 24 on this list, regarding sql.php:
>
>     -------
>     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.
>     -------
>
>     In summary, you should transform all places where we include sql.php, to
>     a function call that deals with $sql_query.
>
>
> Hi Marc,
> I can see certain high level functions that sql.php does such as
> executing the query, displaying results, and sending values for set,
> enum and relational fields. But apart from these functions sql,php does
> some other work such variable setting (db, table), setting error url
> etc. If I am going to change the paces where sql.php is including with
> function calls to sql,lib.php how can I do the above mentioned tasks.
> Have I got this correct or am I missing something.

Hi Supun,
this is a good question. In your research, you will have to verify 
whether these other tasks are needed for the operation.

For example, take a look at tbl_select.php. When the user enters the 
search criteria and hits Go, the POST parameters already contain db and 
table. Then, sql.php is called at the very end when we have to execute 
$sql_query.

In this case, I bet that the db and table parameters received by 
tbl_select.php are used by sql.php, so they could be passed to a 
function call at this point.

It's possible that some long chunks of code, for example the one when at 
least one row is returned, will need to be extracted.

-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list