NuSphere Forums Forum Index
NuSphere Forums
Reply to topic

When you code which do you use?
$HTTP_[POST|GET|ENV|SERVER|COOKIE|SESSION]_VARS
0%
 0%  [ 0 ]
$_[POST|GET|ENV|SERVER|COOKIE|SESSION|FILES|REQUEST]
100%
 100%  [ 9 ]
Total Votes : 9

Remove $HTTP_* vars using $_* instead in debug windows?


Joined: 03 Apr 2004
Posts: 78
Reply with quote
Is it possible, either through PHPEd configuration (in files if not through GUI configuration), or through DBG configuration, to OMIT certain variables from being reported (IE: I do not want them to be listed in my debug windows: global/local).

I wish to remove the old PHP variables:

$HTTP_POST_VARS
$HTTP_GET_VARS
$HTTP_ENV_VARS
$HTTP_SERVER_VARS
$HTTP_COOKIE_VARS
$HTTP_POST_FILES
$HTTP_SESSION_VARS

to instead ONLY use the new versions:

$_POST, $_GET, $_ENV, $_SERVER, $_COOKIE, $_FILES, $_SESSION, $_REQUEST

I do not see a need of clutering my debug windows with old vars when new ones are shorter and afford more screen real estate during debugging, and they are indeed identical in all respects to their older counterparts.

Is this possible? If so how?

If it is not currently possible, it should be, and toggleable from within PHPEd (if it's something PHPed is responsible for handling) or atleast in the documentation so we can tweak our DBG.

Thanks in advance.
View user's profileFind all posts by Rick ChristySend private messageYahoo Messenger
PHP5 contains configuration directive for this.


Joined: 03 Apr 2004
Posts: 78
Reply with quote
register_long_arrays boolean

Tells PHP whether or not to register the deprecated long $HTTP_*_VARS type predefined variables. When On (default), long predefined PHP variables like $HTTP_GET_VARS will be defined. If you're not using them, it's recommended to turn them off, for performance reasons. Instead, use the superglobal arrays, like $_GET.

---

Upgrading to PHP 5 seems like the solution?

Is this possible using PHP 4?
View user's profileFind all posts by Rick ChristySend private messageYahoo Messenger
For those of you looking to do this


Joined: 03 Apr 2004
Posts: 78
Reply with quote
It is simple to get this to work. Little investigation went a long way in this case:

Download the PHP5 package for PHPed v3.3

Setup the SRV web server (I use this to test locally so will obviously be differrent for 3rd party web server) .php extension to run the newly installed php5/php-cgi.exe (same as the new .php5 extension).

That's it. The "long arrays" will disappear from your debug windows, until you use them. Except $HTTP_SESSION_VARS still gets registered when session_start() runs -- probably for backwards compatibility reasons.

Anyway, hope this helps someone Smile
View user's profileFind all posts by Rick ChristySend private messageYahoo Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Thanks for such a self-contained post Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Re: PHP5 contains configuration directive for this.


Joined: 03 Apr 2004
Posts: 78
Reply with quote
Rick Christy wrote:

Is this possible using PHP 4?


Yes. Some common sense later:

Code:
// Remove legacy PHP 4 duplicate variables
unset($HTTP_SERVER_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_POST_FILES, $HTTP_REQUEST_VARS, $HTTP_SESSION_VARS, $HTTP_COOKIE_VARS, $HTTP_ENV_VARS);


Save and name this as autoexec.php and use

Code:
auto_prepend_file = c:\servers\php\autoexec.php


Or optionally just put that line of code as first line in script. PHPED happilly acknowledges your unset desires and removes the legacy variables from the debug window.

Hopefully this helps someone Smile
View user's profileFind all posts by Rick ChristySend private messageYahoo Messenger
Remove $HTTP_* vars using $_* instead in debug windows?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic