I have a file that is like a library for all of my classes, RegistryDB.php. I also have a configuration file, config.ini, that I load at the top of RegistryDB.php into an object called "rdb_config" that I instantiate right at the start of the script.
Shouldn't I be able to access "rdb_config" inside each of these separate classes, since I declared it at the top of the script and not inside any particular class? Or if I can't, what's a good methodology for making "rdb_config" available to each of these classes in my library without having to load config.ini everytime I instantiate a new class?
Example-
<?php
$rdb_config = new Configuration(); //loads the .ini file and assigns values to object properties, that all works fine
class jRegistryUser
{
function showUser()
{
echo $rdb_config->USER; //nothing shows up!
}
}
Is this not valid? How do I go about setting this up?