Best method for debugging webservice called in php?

I have an n-tier system in which the frontend template interface calls the application server. For example, I need to get some search results, and the external interface calls the backend to get the results.

Both the template engine and application server are written in PHP. I am currently using PHPed to initiate debugging sessions for the template engine, however, when the HTTP request goes to the remote service, my debugger just sits and waits for the I / O to complete.

What I would like to do is emulate an HTTP call, but really just stay inside my PHP process, do a giant push of the environment on some stack, and then load and process the application environment calls. After the call is completed, I make env pop and get the results of the http call in var (for example, through the output buffer). I can run both services on the same server. Does anyone have ideas or libraries that already do this?

+5
source share
7 answers

Can you start the debugger and set a breakpoint on the application server? Two different debugging sessions - one for picking up a call to the engine template and one for picking up a call in the application server.

.

, , .

+2

, ,

    debugBreak(); 

? (, ).

, , AMFPHP. PHP, Flash , PHP AMFPHP, . debugBreak(), PhpED .

+1

HTTP-? - tcpflow.

XML .

, , , . , , .

, , , mocks. , "", .

, .

+1

, PHP, ? , , .

, , Zend HTTP-, HTTP / (:), , .

, fopen ('http://...') fread , , http: support .

+1

PHP , , " - ", , netcat + ?

netcat :

  • HTTP-
  • - ( - , !)

http://www.plenz.com/netcat-tips

, - :

echo "<xml .. <node>hello php!</node>" | netcat -lp 80 ... etc

... , , , , , -.

script netcat , -, - , PHP , ?

.

netcat webserver http://img240.imageshack.us/img240/791/netcat.jpg

+1

, Charles. - - , . linux, os/x windows.

HTTP .

+1

PhpED - , , . , , - ​​ . , DBGSESSID ( ) . $_COOKIES / $_GET ( , ) IDE usign Debugger Toolbar). (), POST URL cookie. f.e. get/post/cookies, DebugBreak(). , IDE IP- IDE - . LinuxSE ( SE Linux ). , , .

If it is not possible to connect to the server with the IDE (if the workstation with the IDE is on a different network, for example, at your home), you can use ssh . In this case, of course, the IDE is localhost.

0
source

All Articles