vtiger debug 调试错误

vtiger 5.2.0 的调试

数据库调试,在需要的页面,加入以下代码即可 

global $adb;
$adb->setDebug(true);

  打开log日志调试

1.先找到config.performance.php  把 'LOG4PHP_DEBUG' => false改为 'LOG4PHP_DEBUG' => true

2.找到log4php.properties,把log4php.rootLogger=FATAL,A1 改为log4php.rootLogger=INFO,A1

以前版本的调试看这里

PHP Files (*.php)

  1. To print all the SQL commands to the browser.
    In include/database/PearDatabase.php near line 680 replace:
    //$this->database->debug = true;
    with:
    $this->database->debug = true;
  2. To print DEBUG log data to the logfile logs/vtigercrm.log.
    In log4php.properties replace:
    log4php.rootLogger=FATAL,A1
    with:
    log4php.rootLogger=DEBUG,A1
  3. To print a value (or array) to the browser, insert the following in the PHP file:
    trigger_error('TempDebug: $someVariable="' 
                 .print_r($someVariable, TRUE) .'"');

    Don't forget to remove it afterward! :-)

  4. Better still, to print an array to the browser in a more legible format we add opening and closing HTML
    tags:
    trigger_error('TempDebug: $smallArray=
    "' 
                  .print_r($smallArray, TRUE) .'"
    '); Note however that trigger_error() truncates the output if the array is large. The following works on large arrays:
    trigger_error('TempDebug: $largeArray:...'); 
    print_r("
    ");
    print_r($largeArray);
    print_r("
    ");

Smarty Templates (*.tpl)

Smarty templates are used to programatically create HTML pages.

  1. To list all the data available to a Smarty template in a separate browser window:
    In /Smarty/libs/Smarty.class.php near line 104 replace:
    var $debugging       =  false;
    with:
    var $debugging       =  true;
  2. In a Smarty template data can be "printed" into an HTML comment and then viewed by selecting View->Page Source in your browser. This example shows some of the parameters "passed" from PHP code to a Smarty template:

AJAX and JavaScript (*.js)

Warning: Changes in AJAX code may require matching changes in Smarty code!

  1. To print a value (or array) to a brower message box, insert the following in the JavaScript file:
    alert('TempDebug: someVariable = "' +someVariable +'"');
  2. A JavaScript debugger is available for Firefox, Mozilla, Netscape [1].

转载于:https://my.oschina.net/wangwang110/blog/11185

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值