Using the following as an example (with $db being a previously created database connection object)...
Class Session {
function write_log () {
global $db;
$db->query(...);
}
}
Is there a way to avoid having to write "global $db" everytime I want to use the $db object inside of another class? In other words, declare the $db object as a superglobal from the very beginning.