[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.pdt] Re: Newbie Getting "print" output to browser during debug?

It would not be possible to maintain backward compatibility with the change that was made. It was an area of the specification that wasn't clear if it had to be explicitly handled or not and as xdebug prior to 2.0.3 didn't use it, I hadn't implemented code to handle it, so cant really blame Derick for the problem.
PDT 1.0.3 should be able to handle xdebug 2.0.2 and 2.0.3 without any problems. I don't think the support made it into 1.0.3rc1 through.


Dave Kelsey

Dan wrote:
Hi Dave,

Fantastic, thanks for the super quick response! I'll downgrade to 2.0.2 right away. I actually was running 2.0.2 and only upped to 2.0.3 when I saw it today on the site. So much for dot-dot releases maintaining backward compatibility!

On 2008-05-14 18:37:18 +1000, Dave Kelsey <dkel50@xxxxxxxxxxx> said:

Hi Dan, xdebug 2.0.3 is not supported unfortunately. The author made a change in 2.0.3 which altered the protocol and as such PDT 1.0.2 cannot work correctly with it. As you have experienced, the debug session never terminates when the request ends. For PDT 1.0.2 you need to use Xdebug 2.0.2. Support for Xdebug 2.0.3 wil be available in PDT 1.0.3 and PDT 1.1.

It looks like you can get xdebug 2.0.2 from the following link
http://www.xdebug.org/link.php?url=xdebug202-52-win

As for your other issue, you may want to take a look at flush() for more information.

http://www.php.net/flush

Dave Kelsey.


Dan wrote:
Hi all,

Newbie question:

Using XDebug 2.0.3/PHP 5.2.6 here on OS X 10.5.

When debugging as a "PHP Web page" (as opposed to a "PHP Script"), is there any way to get the script being debugged to generate its output to the browser immediately? It appears to set some sort of output buffering occurs.

Take the following piece of code:

<?php
header("content-type: text/html");
print "This is a test<br>\n";

$t = new testme();

$t->doit(2);

print "done<br>\n";
exit(0);

class testme {
    public function __construct() {
        print "Constructing<br>\n";
        error_log("Constructor",0);
    }
        /**
     * Great little function
     *
     * @param int $id - a lovely number
     */
    public function doit($id) {
        print "Doing it with id $id...<br>\n";
    }
}
?>

If I set a breakpoint at the "public function doit($id) {" line and hit Debug, the script appears to execute on the server (the results of the error_log() are written to the log) up until the breakpoint.

However, none of the "print" calls appear to be getting executed until I restart the process, click "Remote Launch" in the Debug view and then the "Terminate" button - at which point all the output is displayed and the process exits (at which point a second browser window opens for me saying "DEBUG SESSION ENDED".

Is there any way I could configure PDT/XDebug to instruct PHP to output the results of the print calls immediately, rather than waiting for the debugging session to end?

Thanks in advance!