What’s the best way to structure my code so that I don’t have to write out my database/user/password credentials, create a new xPDO object and do an ->addPackage() on it in every resource/snippet where I need to use my external db xpdo object?
$myFullyLoadedReadyToGoXPDoObject = ??
It seems like at a minimum I’d have to have two lines - an include statement and a function call. I tried to write a snippet that returned the object, but apparently I’d have to use serialize/unserialize, which requires including the class def. That doesn’t seem any better than including a php file with a function that returns the object, then calling that object.
Thoughts?