[PHP] register_globals off or on, why on

2002-08-25 Thread Peter J. Schoenster

Hi,

I'm working on a site where I'm using geeklog 
http://geeklog.sourceforge.net/ 

It has the requirement that 

 Geeklog needs the register_globals variable turned on in order to work.
 Since PHP 4.2.0, the default for register_globals is off. To fix it,
 simply add the following line to your php.ini file

Is this not *wrong*. It sounds to me like fake laziness. Nothing drives 
me bonkers more than trying to track down a variable that is inherited 
from who knows where. 

Perhaps I'm missing something. I've recently worked on a lot of PHP 
code written by others and it's a nightmare trying to track down where 
a variable is defined and where it's value might be changed.  Perhaps 
there is some tool I can use to trace this. I dunno. 

Am I correct in my aversion to globals or I am I missing their true 
value and perhaps some tools I could use when working on apps that have 
more than 50 php files floating all over the place and no 
documentation.

Peter





---
Reality is that which, when you stop believing in it, doesn't go
away.
-- Philip K. Dick


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] register_globals off or on, why on

2002-08-25 Thread Rasmus Lerdorf

 I'm working on a site where I'm using geeklog
 http://geeklog.sourceforge.net/

 It has the requirement that

  Geeklog needs the register_globals variable turned on in order to work.
  Since PHP 4.2.0, the default for register_globals is off. To fix it,
  simply add the following line to your php.ini file

 Is this not *wrong*. It sounds to me like fake laziness. Nothing drives
 me bonkers more than trying to track down a variable that is inherited
 from who knows where.

If you initialize all your local variables, there is nothing wrong with
having register_globals on.  Well-written apps run quite nicely and
securely with them on.  The reason to turn them off is to protect yourself
from crappy code.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php