ฉันมีระบบการพัฒนา display_errors เปิดอยู่ Magento อยู่ในโหมดนักพัฒนาซอฟต์แวร์และฉันพยายาม
Mage::log($layered_navigation_filter_block); // Mage_Catalog_Block_Layer_Filter_Attribute
และทุกอย่างถูกเขียนลงบนหน้าจอแทนที่จะเป็นไฟล์บันทึกทำไม?
ดูเหมือนว่ากรณีนี้:
// app/Mage.php:837
if (is_array($message) || is_object($message)) {
$message = print_r($message, true);
}
แต่อาร์กิวเมนต์ที่สองจาก print_r จะถูกละเว้น:
Mage_Catalog_Block_Layer_Filter_Category Object ( [_filter:protected] => ...
[28-Jan-2013 22:48:43 UTC] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 241434624 bytes) in /var/www/app/code/local/MyCompany/Motif/Model/Observer.php on line 47
[28-Jan-2013 22:48:43 UTC] PHP Stack trace:
[28-Jan-2013 22:48:43 UTC] PHP 1. {main}() /var/www/index.php:0
[28-Jan-2013 22:48:43 UTC] PHP 2. Mage::run() /var/www/index.php:87
[28-Jan-2013 22:48:43 UTC] PHP 3. Mage_Core_Model_App->run() /var/www/app/Mage.php:683
[28-Jan-2013 22:48:43 UTC] PHP 4. Mage_Core_Controller_Varien_Front->dispatch() /var/www/app/code/core/Mage/Core/Model/App.php:354
[28-Jan-2013 22:48:43 UTC] PHP 5. Mage_Core_Controller_Varien_Router_Standard->match() /var/www/app/code/core/Mage/Core/Controller/Varien/Front.php:176
[28-Jan-2013 22:48:43 UTC] PHP 6. Mage_Core_Controller_Varien_Action->dispatch() /var/www/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php:250
[28-Jan-2013 22:48:43 UTC] PHP 7. Mage_Catalog_CategoryController->viewAction() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:419
[28-Jan-2013 22:48:43 UTC] PHP 8. Mage_Core_Controller_Varien_Action->generateLayoutBlocks() /var/www/app/code/core/Mage/Catalog/controllers/CategoryController.php:146
[28-Jan-2013 22:48:43 UTC] PHP 9. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Controller/Varien/Action.php:344
[28-Jan-2013 22:48:43 UTC] PHP 10. Mage_Core_Model_Layout->generateBlocks() /var/www/app/code/core/Mage/Core/Model/Layout.php:210
[28-Jan-2013 22:48:43 UTC] PHP 11. Mage_Core_Model_Layout->_generateBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:205
[28-Jan-2013 22:48:43 UTC] PHP 12. Mage_Core_Model_Layout->addBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:239
[28-Jan-2013 22:48:43 UTC] PHP 13. Mage_Core_Model_Layout->createBlock() /var/www/app/code/core/Mage/Core/Model/Layout.php:472
[28-Jan-2013 22:48:43 UTC] PHP 14. Mage_Core_Block_Abstract->setLayout() /var/www/app/code/core/Mage/Core/Model/Layout.php:456
[28-Jan-2013 22:48:43 UTC] PHP 15. Mage::dispatchEvent() /var/www/app/code/core/Mage/Core/Block/Abstract.php:239
[28-Jan-2013 22:48:43 UTC] PHP 16. Mage_Core_Model_App->dispatchEvent() /var/www/app/Mage.php:447
[28-Jan-2013 22:48:43 UTC] PHP 17. Mage_Core_Model_App->_callObserverMethod() /var/www/app/code/core/Mage/Core/Model/App.php:1317
[28-Jan-2013 22:48:43 UTC] PHP 18. MyCompany_Motif_Model_Observer->coreBlockAbstractPrepareLayoutAfter() /var/www/app/code/core/Mage/Core/Model/App.php:1338
[28-Jan-2013 22:48:43 UTC] PHP 19. print_r() /var/www/app/code/local/MyCompany/Motif/Model/Observer.php:47
ตกลงเกิดข้อผิดพลาดร้ายแรงไม่มีการลงทะเบียน shutdown_function ดังนั้นเหตุใด print_r จึงดังขึ้น :-) ฉันยังไม่เข้าใจว่าเกิดอะไรขึ้น