Using PHP, I would like to set variables and re use them in multiple locations, kind of like settings for an app. I was trying to stay away from both session and global variables and was wondering what kind of ideas you guys had to accomplish this.
IE: I would like to set a variable once whether its $var = 1; or $var = new Class(); and refrence $var throughout the whole app with out declaring it as a new class or setting the variable again, including inside of functions or classes.
Any and all input would be appreciated, Thank you
I would recommend looking into dependency injection.