views:

22

answers:

1

I've searched for Zend discussions on scoping and I know there are framework nuances that would seem to indicate there is some server-side memory, but I can't pin it down for sure. Does the existence of Singletons indicate that they are loaded once per Application, or once per session? It doesn't make sense that a Singleton should be described as such if its simply reloaded at every request.

And how do language terms such as require_once() indicate that these are loaded once and kept throughout the Application or Session? Or again are these somehow simply rebuilt at every request or page scope?

I'd appreciate any help and links I could get to understand the big picture of the ZF and php pages. PHP pages themselves seem very much page-by-page with no carry over, but that doesn't make sense with these Zend references unless Zend is doing something larger.

Any suggestions on understanding this? Thanks!

+3  A: 

PHP scripts will only persist for the duration of the request. Everything is wiped out when the request ends.

Zend Framework is no different from this. The reason an object is called singleton in it is because you can only have one instance of it.

Jani Hartikainen