开发者

Does Zend_Registry live until next user request?

Does Zend_Registry live until next user request?

I put this code in the end of index.php file in zend project:(The code inside existing zend website)

Trial code:

 开发者_如何转开发   //end of index.php file
    Bootstrap::run();
    //trial for find out the life of Zend_Registry.
    $registry = Zend_Registry::getInstance();
    if (!isset($registry['index1'])) {
        Zend_Registry::set('index1', 'value7');
        echo '<h1>Zend_Registry was unset</h1>';
    } else {
        echo '<h1>Zend_Registry was set</h1>';
    }

Results after each click to home page:

Zend_Registry was unset

Thanks


No, Zend_Registry is just for the current request. If you want data to persist between requests you'd need to store it in the session.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜