I have a Java background. So please bear with me.
In a Java application, one way to perform one time initialization is to have an "Initializer Servlet" whose init() method can have one time initialization code. Another more general purpose mechanism is to have a Singleton that initializes on first use - and this mechanism will work in various languages / platforms. What I need to know is how to do it for my PHP webapp.
Should I use the Singleton Pattern? Is there another / better / PHP specific way? Essentially I want have a "Registry" - a single instance of it - which I can then use to create instances of other objects (themselves Singleton or not depends on situation at hand).
The ultimate goal is - I need certain things initialized BEFORE any web request is served by my PHP web application - something an "Initializer Servlet" in Java guarantees me. Maybe there is an "Initializer PHP Page" or something like that?
Thanks in advance