[Phpmyadmin-devel] Re: Removing of grab_globals

Marc Delisle Marc.Delisle at cegepsherbrooke.qc.ca
Wed Dec 7 11:42:04 CET 2005


Sebastian Mendel a écrit :
> Marc Delisle schrieb:
> 
>> FYI, look what the Mambo team has done in their globals.php script. 
>> They are populating $GLOBALS. Not sure I approve their method. Comments?
> 
> 
> btw. what exactly means FYI?

For Your Information

> 
> 
>> -----------
>> $raw = phpversion();
>> list($v_Upper,$v_Major,$v_Minor) = explode(".",$raw);
>>
>> if (($v_Upper == 4 && $v_Major < 1) || $v_Upper < 4) {
>>         $_FILES = $HTTP_POST_FILES;
>>         $_ENV = $HTTP_ENV_VARS;
>>         $_GET = $HTTP_GET_VARS;
>>         $_POST = $HTTP_POST_VARS;
>>         $_COOKIE = $HTTP_COOKIE_VARS;
>>         $_SERVER = $HTTP_SERVER_VARS;
>>         $_SESSION = $HTTP_SESSION_VARS;
>>         $_FILES = $HTTP_POST_FILES;
>> }
> 
> 
> this is not reqired for PMA as, IMHO, pma does not run on PHP < 4.1 
> (like the documentation read)
> 
> 
>> if (!ini_get('register_globals')) {
>>         while(list($key,$value)=each($_FILES)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=each($_ENV)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=each($_GET)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=each($_POST)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=each($_COOKIE)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=each($_SERVER)) $GLOBALS[$key]=$value;
>>         while(list($key,$value)=@each($_SESSION)) $GLOBALS[$key]=$value;
>>         foreach($_FILES as $key => $value){
>>                 $GLOBALS[$key]=$_FILES[$key]['tmp_name'];
>>                 foreach($value as $ext => $value2){
>>                         $key2 = $key . '_' . $ext;
>>                         $GLOBALS[$key2] = $value2;
>>                 }
>>         }
>> }
> 
> 
> they emulate register_globals! this is nto what we want to do? as this 
> is what we are currently doing! not exactly ...
> 
> 
You're right, this is not what we want to do.
Marc





More information about the Developers mailing list