My defs.php has a define that I need, and although I used require_once for it, when I try to access defs.php, I get a series of duplicates as if the defs.php was already called before.
On the other hand, if I don’t call it, I get undefined use of undefined constant…
Any ideas?
Thanks!
Probably you’re using 2 separate paths to the file. I’ve seen this issues when doing:
I think php keep track of what’s been included in a way that doesn’t intelligently assess all possible path combinations to the same file and treat it as the same.
I try to avoid using requires and includes by wrapping everything in object and using an autoloader. For constants, I make an object with a bunch of static properties.