Questions tagged «singleton»

5
法师注册表项“ _singleton / weee / observer”已存在
当我尝试添加或编辑产品时,出现以下错误: Mage registry key "_singleton/weee/observer" already exists Trace: #0 app/Mage.php(222): Mage::throwException('Mage registry k...') #1 app/Mage.php(476): Mage::register('_singleton/weee...', false) #2 app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('weee/observer') #3 app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('adminhtml_catal...', Array) #4 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Attributes.php(143): Mage::dispatchEvent('adminhtml_catal...', Array) #5 app/code/core/Mage/Adminhtml/Block/Widget/Form.php(144): Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Attributes->_prepareForm() #6 app/code/core/Mage/Core/Block/Abstract.php(862): Mage_Adminhtml_Block_Widget_Form->_beforeToHtml() #7 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php(79): Mage_Core_Block_Abstract->toHtml() #8 app/code/core/Mage/Core/Block/Abstract.php(238): Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs->_prepareLayout() #9 app/code/core/Mage/Core/Model/Layout.php(456): Mage_Core_Block_Abstract->setLayout(Object(Mage_Core_Model_Layout)) #10 app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('adminhtml/catal...', 'product_tabs') #11 app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('adminhtml/catal...', …

3
了解Magento注册表
我一直想知道,所有注册表数据都存储在Magento中吗? 我知道,即使单例对象也存储在注册表中。注册表只是Mage类的静态数组变量。 我有几个问题可以消除我的困惑: 注册表对于不同的用户是否有所不同?我的意思是它是基于每个用户(每个HTTP请求)创建的吗? 例如, Mage::register('foo', 'Hello World'); //set a value for foo Mage::registry('foo'); //will this return hello world for all HTTP users ? 注册表数据是否存储在会话中?如果不是,Magento将如何识别哪个用户调用了注册表数据? 我已经阅读了Alan Storm的博客文章,以及他在StackOverFlow上对此的回答。但是我无法消除混乱。如果我认为我的基础知识搞砸了,请纠正我。谢谢
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.