vtiger debug 디버그 오류

2853 단어

vtiger 5.2.0 디버그


데이터베이스 디버깅, 필요한 페이지에 아래 코드를 추가하면 됩니다


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


로그 디버그 열기


1. config를 먼저 찾습니다.performance.php는'LOG4PHPDEBUG'=> false에서'LOG4PHPDEBUG' => true
2. log4php. 찾기properties,log4php.rootLogger=FATAL, A1에서 log4php.로 변경rootLogger=INFO,A1

이전 버전의 디버깅 여기 보세요.


PHP Files (*.php)

  • 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;
  • To print DEBUG log data to the logfile logs/vtigercrm.log.In log4php.properties replace:
    log4php.rootLogger=FATAL,A1
    with:
    log4php.rootLogger=DEBUG,A1
  • 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! :-)
  • 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.
  • 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;
  • 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!
  • To print a value (or array) to a brower message box, insert the following in the JavaScript file:
    alert('TempDebug: someVariable = "' +someVariable +'"');
  • A JavaScript debugger is available for Firefox, Mozilla, Netscape [1].
  • 좋은 웹페이지 즐겨찾기