Because I am OOP fan, I'd rather create a static class, using public static fields, so you can reach those variable as like ConstClass::MyConstant. In that way, you have the advantage of simply create new constants, and it doesn't matter how many times you include this file, there will be only one instance.
SanTa 2011.01.05. 23:40 keltezéssel, Paul Halliday írta:
Say you have 10 or so scripts and a single config file. If you have main.php, functions1.php, functions2.php, functions3.php.. Does is hurt to do an include of the config file in each separate script, even if you only need a few things from it, or should you just specify what you want with a 'global' within each script/function? Thanks!
<<attachment: smime.p7s>>