Magento And Drupal : Small Tips
来源:互联网 发布:软件行业增值税税负 编辑:程序博客网 时间:2024/04/29 13:14
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);
}
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);
}
- Magento And Drupal : Small Tips
- Drupal Tips
- flex small tips 小结
- My Computer's Small Tips
- Android Studio some small tips
- [2016/8/26]small tips
- float, small and random
- 5 Tips for Designing Small Spaces
- Form Level Debug (FRD Debug Small Tips)
- Big Endian and Small Endian
- TCP and UDP Small Servers
- CMS Series:Joomla and Drupal
- Drupal debugging: Xdebug and Devel
- butterfly 安装目录下的文件small tips
- 不积跬步,无以至千里 small tips
- 6 Tips for Making Magento Production Ready
- Services for self-employed and small businesses
- Small Business and Open Source eCommerce Platform
- [Magento] Product Import Scripts
- [Magento] Get the native SQL
- How to know whether the attribute belongs to one types of productin Magento?
- Magento Upgrade
- One big topic in Drupal: theme
- Magento And Drupal : Small Tips
- Drupal Blocks:What Changed in D6 and D7
- Overview Of The Drupal Module Info File
- Top Ten Best Drupal 7 Contributed Modules
- Custom Field Handlers for Views
- [Magento] Email Template Enhancement
- Oracle中的用户管理的不完全恢复
- Drupal Form API
- Entities, Bundles,Fields and Field instance