Single Location for db connection info2 users found helpful
That is the best place, IMO.
I misunderstood the question, my bad. ^_^
Recipie 10.15 from O'Reilly's PHP Cookbook...
10.15 Accessing a Database Connection Anywhere in Your Program
You’ve got a program with lots of functions and classes in it, and you want to maintain a single database connection that’s easily accessible from anywhere in the program.
Use a static class method that creates the connection if it doesn’t exist and returns the connection.
So, in config/site.php you already have
And connect to it. config/site.php is always loaded so those constants should be available everywhere at all times.