"global" in PHP is the devil?
#11
Matt made a very good point. When using classes, its good practice when possible to "extend" a base class, so that everything is available via $this. That is (mostly) how the Merge System is built, and I've no idea why I didn't think to mention it Wink
Reply
#12
Doh. Now I look like an idiot for not reading it thoroughly. Sad

Quote:I'm developing a script and I can say that it's going to be very hard for me to re-code everything into a non-global environment

I still don't think you should worry about a huge conversion to OOP on an already existing script. Recoding sucks and unless required why bother? I have sites running from php3 still that aren't bothering anyone. As long as they run who gives a crap what the backend looks like.
Reply
#13
^
Exactly, security is the most important thing Smile


(2012-01-12, 05:08 PM)Dylan M. Wrote: Matt made a very good point. When using classes, its good practice when possible to "extend" a base class, so that everything is available via $this. That is (mostly) how the Merge System is built, and I've no idea why I didn't think to mention it Wink

That's a good practice too Smile
Rasmus Lerdorf Wrote:If eval() is the answer, you're almost certainly asking the wrong question. - Rasmus Lerdorf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)