<br><br><div class="gmail_quote">On Fri, Apr 6, 2012 at 5:21 PM, Marc Delisle <span dir="ltr"><<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Le 2012-04-06 07:38, Ammar Yasir a écrit :<br>
<div><div class="h5">> On Tue, Apr 3, 2012 at 8:23 PM, Marc Delisle <<a href="mailto:marc@infomarc.info">marc@infomarc.info</a>> wrote:<br>
><br>
>> Le 2012-04-02 18:39, Ammar Yasir a écrit :<br>
>>> Hi,<br>
>>> Can we have more clarity on improving reference to global variables. Is<br>
>> the<br>
>>> following snippet an example of the same where?<br>
>>> (From tbl_select.php, $_POST parameters are referenced through $GLOBALS)<br>
>>> $post_params = array(<br>
>>> 'ajax_request',<br>
>>> 'collations',<br>
>>> 'db',<br>
>>> 'distinct',<br>
>>> 'fields',<br>
>>> 'func',<br>
>>> 'max_number_of_fields',<br>
>>> 'names',<br>
>>> 'order',<br>
>>> 'orderField',<br>
>>> 'param',<br>
>>> 'session_max_rows',<br>
>>> 'table',<br>
>>> 'types',<br>
>>> 'where',<br>
>>> );<br>
>>> foreach ($post_params as $one_post_param) {<br>
>>> if (isset($_POST[$one_post_param])) {<br>
>>> $GLOBALS[$one_post_param] = $_POST[$one_post_param];<br>
>>> }<br>
>>> }<br>
>><br>
>> Ammar,<br>
>> this snippet is code added recently, to be able to remove the<br>
>> grab_globals.lib.php library.<br>
>><br>
>> tbl_select.php uses globals instead of directly referencing<br>
>> $_POST['foo'] so this snippet was a way to keep the script working until<br>
>> better refactoring.<br>
>><br>
>> However, many scripts are using other global variables as a way to<br>
>> communicate between them or between functions, and we should try to<br>
>> minimize this behavior.<br>
>><br>
>> Is the use of $sql_query variable as a GET variable for sql.php an<br>
> example of the same?<br>
> (communication between scripts)<br>
<br>
</div></div>GET and POST variables are always about communication between scripts,<br>
right?<br>
<br>
I meant that some functions are either using the global keyword or<br>
$GLOBALS to reach some global variables. Also, procedural code in<br>
included files are using global variables.<br>
<div class="im"><br></div></blockquote><div>Okay, thanks for clarifying. I submitted my proposal for Refactoring: table search, db search and multi-table query. I know it's very late but any comments will be very helpful.</div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
--<br>
Marc Delisle<br>
<a href="http://infomarc.info" target="_blank">http://infomarc.info</a><br>
<br>
------------------------------------------------------------------------------<br>
</div>For Developers, A Lot Can Happen In A Second.<br>
Boundary is the first to Know...and Tell You.<br>
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!<br>
<a href="http://p.sf.net/sfu/Boundary-d2dvs2" target="_blank">http://p.sf.net/sfu/Boundary-d2dvs2</a><br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Phpmyadmin-devel mailing list<br>
<a href="mailto:Phpmyadmin-devel@lists.sourceforge.net">Phpmyadmin-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel</a><br>
</div></div></blockquote></div><br>