ZF-8855: Zend_Layout problem with double class initialization

Issue Type: Bug Created: 2010-01-17T23:32:47.000+0000 Last Updated: 2012-11-20T21:38:09.000+0000 Status: Open Fix version(s): Reporter: Igor Kazakov (nampuom) Assignee: None Tags: - Zend_Layout

Related issues: Attachments:


Problem with Zend_Layout - on some server configurations a have Fatal Error: Cannot redeclare class Zend_View_Helper_Placeholder_Registry After inspect code, i found problem. Class Zend_View_Helper_Placeholder_Registry including in Zend_Layout in function _initVarContainer() look like this:

protected function _initVarContainer() { if (null === $this->_container) { require_once 'Zend/View/Helper/Placeholder/Registry.php'; $this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(CLASS); }

    return $this->_container;

This function not use class_exists() ( e.g. func_initHelper() using this checker). After corrections func _initVarContainer() works good in all my webservers:

protected function _initVarContainer() { if (null === $this->_container) { if(!class_exists('Zend_View_Helper_Placeholder_Registry')){ require_once 'Zend/View/Helper/Placeholder/Registry.php'; } $this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(CLASS); }

    return $this->_container;

That's all. Thanks!


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.