[Phpmyadmin-devel] Source of $_POST['fields'] variables

Marc Delisle marc at infomarc.info
Wed Jun 12 18:31:06 CEST 2013


Supun Nakandala a écrit :
> On Wed, Jun 12, 2013 at 9:05 PM, Supun Nakandala
> <supun.nakandala at gmail.com>wrote:
> 
>>
>>
>> On Wed, Jun 12, 2013 at 8:56 PM, Marc Delisle <marc at infomarc.info> wrote:
>>
>>> Marc Delisle a écrit :
>>>> Supun Nakandala a écrit :
>>>>> Hi,
>>>>> I am refactoring sql.php and I want to rename the $_POST['fields'][...]
>>>>> variables such that they better reflect their intended use. I was
>>> trying to
>>>>> find out the origin of these variables and I was not successful. I
>>> would
>>>>> appreciate if someone can help me to find the source and the rationale
>>> of
>>>>> these variables.
>>>> Hi Supun,
>>>> do you know the "git blame" command? This will show you the commit and
>>>> author by line of code.
>>>>
>>> Also, github, via the Files tab, permits you to pick one file and enter
>>> the Blame view for it.
>>>
>>>    Now I am getting familiar with that feature.
>>    Thanks
>>
>>>  --
>>> Marc Delisle
>>> http://infomarc.info
>>
> 
> Hi Marc,
> According to what I understood git blame allows me to find the respective
> contributor for each line of code. But what I am interested about is to
> find the place in code where these $_POST['fields'][...] variables are set.
> How can I find that ?. Please correct me if I am wrong.

This is more tricky. I basically see two ways:

1. Looking for a string in your editor when you know the file, or 
looking via "git grep" when you don't know which file

2. Using an IDE like NetBeans where you can track the execution path at 
the PHP level and set watchpoints (but I'm not sure about watching 
$_POST variables)

In this case, since it comes from a POST, most likely it's located in a 
form so you can start by searching for forms in sql.php.


-- 
Marc Delisle
http://infomarc.info




More information about the Developers mailing list