php 用什么工具单步调试, UltraEdit-32可以单步调试 PHP么?

解决方案 »

  1.   

    zend studio /eclipse都可以实现单步调试
      

  2.   


    执行 ob_start("theme_ob_callback");  
    打印的 Failed to load the theme frame and / or home file theme_ob_callback 函数原形 
    function theme_ob_callback($buffer) {
    global $CONF;

    /*
    Some web servers (e.g. Apache) change the working directory of a script 
    when calling the callback function. Removing the following on those
    servers will change the global path thus prevent PHPizabi from getting
    the theme file thus producing an error output. The following function 
    will change the working directory back to its original value. 
    */
    if (!ckbool($CONF["IIS_COMPATIBILITY_MODE"])) 
    @chdir(@dirname((strstr($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"]) 
    ? $_SERVER["SCRIPT_FILENAME"] 
    : $_SERVER["PATH_TRANSLATED"]
    )));

    /*
    in WAP mode, no theme is required, each template constitutes
    the theme AND the template content. We will just flush the
    buffer to our WAP client.
    */
    if ($GLOBALS["WAP_MODE"]) return $buffer;

    /*
    Handle the chromeless & WAP calls
    */
    echo "CHROMELESS_MODE" ;
    if ($GLOBALS["CHROMELESS_MODE"]) {
    $tpl = new template;
    $tpl -> LoadThis($buffer);
    } else {
    /*
    Handle unshared frame file for home
    */
    echo (!$CONF["SHARE_FRAME_FILE_WITH_HOME"] && (!isset($_GET["L"]) or $_GET["L"] == "" or $_GET["L"] == "HOME")) ;
    if (!$CONF["SHARE_FRAME_FILE_WITH_HOME"] && (!isset($_GET["L"]) or $_GET["L"] == "" or $_GET["L"] == "HOME")) {
    $tpl = new template;
    $tpl -> LoadThis($buffer);
    }

    else { /* 
    Check if the file exists 
    */
    echo "theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"] ;
    echo "AAAAAAAAAAAAAAA\n";
    if (is_file("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"])) { /*
    The THEME file is loaded into the template conversion
    system and procesed. The following will create the new
    template object and push the theme file content into
    its buffer
    */
    $tpl = new template;
    $tpl -> LoadThis(file_get_contents("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"]));
    } /* 
    There has been an error trying to load the theme file... Throw it. 
    */
    else return "Failed to load the theme frame and / or home file!";
    }
    }

    /*
    We will now assign the generic theme-related replacement 
    items, the JUMP call and the ThemePath values are passed
    with the next line.
    */
    $tpl->AssignArray(array(
    "jump"=>$buffer,
    "themePath"=>"theme/{$GLOBALS["THEME"]}",
    "systemVersion"=>$GLOBALS["SYSTEM_VERSION"],
    "siteName"=>$CONF["SITE_NAME"],
    "siteURL"=>"http://".$_SERVER['HTTP_HOST'].str_replace("/index.php", NULL, $_SERVER['PHP_SELF'])
    )); /*
    Include the theme-based bufferProcParse function file if
    it exists, and run it on the buffer.
    */
    if (is_file("theme/{$GLOBALS["THEME"]}/proc.inc.php") && include("theme/{$GLOBALS["THEME"]}/proc.inc.php")) {
    if (function_exists("bufferProcParse")) $buffer_flush_value = bufferProcParse($tpl->Flush(1));
    }
    if (!isset($buffer_flush_value)) $buffer_flush_value = $tpl->Flush(1);

    /*
    The following is the output compression and cleanup
    process. It will at first clean unnecessary codes
    from the output, then gunzip the buffer.
    */
    if (!$GLOBALS["CHROMELESS_MODE"]) { if (ckbool($CONF["POST_PROCESS_CLEAN_OUTPUT"])) {
    $characters_entities = array('/\\r/', '/\\n/', '/\\t/', ' {2,}+/');
    $replacement_values = array('', '', '', ' ');
    $buffer_flush_value = preg_replace($characters_entities, $replacement_values, $buffer_flush_value);
    } if (ckbool($CONF["POST_PROCESS_COMPRESS_OUTPUT"]) and strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
    header("Content-Encoding: gzip");
    $buffer_flush_value = gzencode(
    $buffer_flush_value."<!-- Powered by {$GLOBALS["SYSTEM_VERSION"]} - http://www.PHPizabi.net -->",
    $CONF["POST_PROCESS_COMPRESSION_RATE"]
    );
    }
    else $buffer_flush_value .= "<!-- Powered by {$GLOBALS["SYSTEM_VERSION"]} - http://www.PHPizabi.net -->";
    }

    /*
    The template buffer is flushed and passed back to
    the OB system.
    */
    return (!is_null($buffer_flush_value)?$buffer_flush_value:false); }
      

  3.   

    function theme_ob_callback($buffer) {
    global $CONF;

    /*
    Some web servers (e.g. Apache) change the working directory of a script 
    when calling the callback function. Removing the following on those
    servers will change the global path thus prevent PHPizabi from getting
    the theme file thus producing an error output. The following function 
    will change the working directory back to its original value. 
    */
    if (!ckbool($CONF["IIS_COMPATIBILITY_MODE"])) 
    @chdir(@dirname((strstr($_SERVER["SCRIPT_FILENAME"], $_SERVER["PHP_SELF"]) 
    ? $_SERVER["SCRIPT_FILENAME"] 
    : $_SERVER["PATH_TRANSLATED"]
    )));

    /*
    in WAP mode, no theme is required, each template constitutes
    the theme AND the template content. We will just flush the
    buffer to our WAP client.
    */
    if ($GLOBALS["WAP_MODE"]) return $buffer;

    /*
    Handle the chromeless & WAP calls
    */
    if ($GLOBALS["CHROMELESS_MODE"]) {
    $tpl = new template;
    $tpl -> LoadThis($buffer);
    } else {
    /*
    Handle unshared frame file for home
    */
    if (!$CONF["SHARE_FRAME_FILE_WITH_HOME"] && (!isset($_GET["L"]) or $_GET["L"] == "" or $_GET["L"] == "HOME")) {
    $tpl = new template;
    $tpl -> LoadThis($buffer);
    }

    else { /* 
    Check if the file exists 
    */
    if (is_file("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"])) { /*
    The THEME file is loaded into the template conversion
    system and procesed. The following will create the new
    template object and push the theme file content into
    its buffer
    */
    $tpl = new template;
    $tpl -> LoadThis(file_get_contents("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"]));
    } /* 
    There has been an error trying to load the theme file... Throw it. 
    */
    else return "Failed to load the theme frame and / or home file!";
    }
    }

    /*
    We will now assign the generic theme-related replacement 
    items, the JUMP call and the ThemePath values are passed
    with the next line.
    */
    $tpl->AssignArray(array(
    "jump"=>$buffer,
    "themePath"=>"theme/{$GLOBALS["THEME"]}",
    "systemVersion"=>$GLOBALS["SYSTEM_VERSION"],
    "siteName"=>$CONF["SITE_NAME"],
    "siteURL"=>"http://".$_SERVER['HTTP_HOST'].str_replace("/index.php", NULL, $_SERVER['PHP_SELF'])
    )); /*
    Include the theme-based bufferProcParse function file if
    it exists, and run it on the buffer.
    */
    if (is_file("theme/{$GLOBALS["THEME"]}/proc.inc.php") && include("theme/{$GLOBALS["THEME"]}/proc.inc.php")) {
    if (function_exists("bufferProcParse")) $buffer_flush_value = bufferProcParse($tpl->Flush(1));
    }
    if (!isset($buffer_flush_value)) $buffer_flush_value = $tpl->Flush(1);

    /*
    The following is the output compression and cleanup
    process. It will at first clean unnecessary codes
    from the output, then gunzip the buffer.
    */
    if (!$GLOBALS["CHROMELESS_MODE"]) { if (ckbool($CONF["POST_PROCESS_CLEAN_OUTPUT"])) {
    $characters_entities = array('/\\r/', '/\\n/', '/\\t/', ' {2,}+/');
    $replacement_values = array('', '', '', ' ');
    $buffer_flush_value = preg_replace($characters_entities, $replacement_values, $buffer_flush_value);
    } if (ckbool($CONF["POST_PROCESS_COMPRESS_OUTPUT"]) and strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
    header("Content-Encoding: gzip");
    $buffer_flush_value = gzencode(
    $buffer_flush_value."<!-- Powered by {$GLOBALS["SYSTEM_VERSION"]} - http://www.PHPizabi.net -->",
    $CONF["POST_PROCESS_COMPRESSION_RATE"]
    );
    }
    else $buffer_flush_value .= "<!-- Powered by {$GLOBALS["SYSTEM_VERSION"]} - http://www.PHPizabi.net -->";
    }

    /*
    The template buffer is flushed and passed back to
    the OB system.
    */
    return (!is_null($buffer_flush_value)?$buffer_flush_value:false); }
      

  4.   

    ob_start("theme_ob_callback"); 调用的函数出错,怎么调试? 多谢。
      

  5.   

    if (is_file("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"])) {
    /*
    The THEME file is loaded into the template conversion
    system and procesed. The following will create the new
    template object and push the theme file content into
    its buffer
    */
    $tpl = new template;
    $tpl -> LoadThis(file_get_contents("theme/".$GLOBALS["THEME"]."/".$CONF["FRAME_THEME_FILE"]));
    } /* 
    There has been an error trying to load the theme file... Throw it. 
    */
    else {
    return "Failed to load the theme frame and / or home file!";
    }要进入theme\default\frame.tpl 判断这个文件在不在,文件明明在,可是判断就是走不进正确的分支,走进了return "Failed to load the theme frame and / or home file!"; 错误分支.怎么回事呢?