Ok, maybe I'm missing something here-- or maybe I'm not thinking about classes in the right way. But I have some site-wide config variables in an include file which I want to make available to every class... is there no way to do this?
For example:
include('globals.inc.php'); // defines: $r = 5;
include('myclass.inc.php');
$nc = new myclass;
now, INSIDE of myclass, how do I access $r? obviously, I could just pass $r to myclass when I instantiate the class, but there's actually a ton of globals in globals.inc.php, not just $r; far too many to pass on a command line. and I don't want to use the 'global' command, that's just sloppy ;-)
what's even weirder(?) is that, within myclass, I can't just do the include() since globals.inc.php says $r=5, not $this->r = 5, so it wouldn't even set up the config variables to work within the class properly. argh.
what am I missing here? I'm sure there's a language construct or some way to do this, but I'm not seeing it.
thanks
Eric