I'm trying to debug my install script with no effort. When I try to get any output inside my foreach loop there is no result in my Mage::Log() file.
<?php
$installer = $this;
$installer->startSetup();
$attrCodes = ['attr1', 'attr2', 'attr3'];
$objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup');
Mage::log('hello before foreach');
// get all attributes
foreach ($attrCodes as $attrCode) {
Mage::log('Attribute code: ' . $attrCode);
}
Mage::log('hello after foreach');
$installer->endSetup();
I can see the log info before the foreach loop. But I got no info inside or after that loop.
Isn't it possible to debug an install script? I usually work with PHPStorm and use the internal debugger. But it seems that I'm unable to debug an install script with PHPStorm or with Mage::Log().
EDIT:
I'm totally sorry for this mess.
I didn't give credits to the comment line above the loop so I decided to shorten my code here.
But the truth is I can't call my upgrade script with a line comment.
That is the reason for my problem.
I have to change a line comment to a block comment /**/ and now it works.
Never run into this problem with magento before.