ZF-8855: Zend_Layout problem with double class initialization

Description

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!

Comments

No comments to display