Peculiar issue/feature, can't seem to find anyone else with any info about
it.
Everytime a request is made to the site when using Zend_Layout, it appears
that the request is run twice. I noticed this when using sessions to store
response messages to the user that are removed from the session once they
are displayed. I could never get these messages to display, but after some
investigation and logging to file found out that the request is run twice.
Putting a simple log message in the a bootstrap file will log the message
twice, with every request made to the framework. I confirmed this by
profiling the database queries also.
I thought that perhaps this was something I had done so did a fresh install
as per instructions here: http://framework.zend.com/docs/quickstart and the
boot strap file is still being called twice.
This is a bit concerning as every request to the server seems to be
processed by the server twice before returning a response. You should be
able to replicate this by following the instructions in the quickstart
tutorial, stop once you've added the layout, then add a
put_file_contents("/tmp/file", "Message\n", FILE_APPEND) in the
_initDocType() method in the bootstrap class. One browser request will
result in two lines in the file /tmp/file ???
Can someone tell me why this is and if there is anyway to prevent this from
happening? It seems a little crazy that by adding a layout we need to
process everything twice.
Running:
PHP 5.2.6
Apache 2.2.9
Zend Framework 1.8
Only modifications to the Quickstart tutorial is added a line to log to file
each request.
Thanks in advance;
Craig
--
View this message in context: http://www.nabble.com/When-using-Zend_Layout-requests-seem-to-run-twice-tp23519804p23519804.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论