[Phpmyadmin-devel] refactoring and superglobals

Marc Delisle marc at infomarc.info
Mon May 7 14:04:41 CEST 2012


Hi,

We previously had a script called grab_globals.lib.php, which created
global variables from a few superglobals arrays.

When this script was removed a few weeks ago, we added at the beginning
of other scripts some code, for example in tbl_change.php:

if (isset($_REQUEST['where_clause'])) {
    $where_clause = $_REQUEST['where_clause'];
}

In the upcoming refactoring efforts, we should avoid this, because,
looking at the code further in the script, it's difficult to see the
origin of $where_clause. So, we should only refer to
$_REQUEST['where_clause'] (except in the situations where the global is
modified afterwards).

Another benefit is that this variable would not need to be passed as a
parameter to functions.

-- 
Marc Delisle
http://infomarc.info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 898 bytes
Desc: OpenPGP digital signature
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120507/42262a8e/attachment.sig>


More information about the Developers mailing list