Magento And Drupal : Small Tips

Sometime, it is easy to use Magento log to track the problem.However, it is hard to find the your desired information as the logfile is large with lots of other information. The better way is tocreate a custom file to store your own debug info. It is easy asfollowing:

  public static function logException(Exception$e)
      {
              if (!self::getConfig()) {
                      return;
              }
              $file = self::getStoreConfig('dev/log/exception_file');
              self::log("\n" . $e->__toString(), Zend_Log::ERR,$file);
      }


There are two methods in the phptemplate.engine.They arephptemplate_init and phptemplate_theme. phptemplate_init()implements hook_init() with argument $template.

The main task of phptemplate_init is to incude the template.phpfime so that functions defined in the template.php can be used atproper time and place.Everyone like will have one doubt about theparameter $template. Where does it come from and what is its datastructure?When the drupal boots, it initialize drupal theme usingdrupal_theme_initialize(). In method drupal_theme_initialize()method, it will list all of themes in the drupal and call themeengine init fuction with theme files parameter.

The following code snippets as proof:

if(function_exists($theme_engine.'_init')){
call_user_func($theme_engine.'_init',$theme);
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值