jcubic/jquery.terminal — pull request #68 by tkoomzaaskz (2013-03-03 21:08:36+00:00)
Title: disable xdebug in rpc output

If xdebug is installed on the computer, rpc output contains all xdebug output, which shows all errors (e.g. missing method arguments). This looks like the following:

You are authenticated
> ls
[AJAX] parsererror - Server reponse is:

( ! ) Warning: Missing argument 2
for Demo::ls() in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 19

Call Stack

#	Time	Memory	Function	Location

1	0.0001	333216	{main}( )<
/td>	../json-rpc-service-demo.php:0

2	0.0001	333728	hand
le_json_rpc( )	../json-rpc-service-demo.php:47

3	0.0003	336048	call_user_func_array
( )	../json-rpc.php:199

4	0.0003	336300	Demo->ls(
)	../json-rpc.php:199

( ! ) Notice: Undefined variable: path i
n /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 21

Call Stack

#	Time	Memory	Fun
ction	Location

1	0.0001	333216	{mai
n}( )	../json-rpc-service-demo.php:0

2	0.0001	333728	handle_json
_rpc( )	../json-rpc-service-demo.php:47

3	0.0003	336048	call_user_func_array
( )	../json-rpc.php:199

4	0.0003	336300	Demo
->ls( )	../json-rpc.php:199

( ! ) Notice: Undefined variable:
path in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 25

Call Stack

#	Time	Memory	Function	Location

1	0.0001	333216	{main}( )<
/td>	../json-rpc-service-demo.php:0

2	0.0001	333728	hand
le_json_rpc( )	../json-rpc-service-demo.php:47

3	0.0003	336048	call_user_func_array
( )	../json-rpc.php:199

4	0.0003	336300	Demo->ls(
)	../json-rpc.php:199

( ! ) Notice: Undefined variable: path i
n /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 25

Call Stack

#	Time	Memory	Fun
ction	Location

1	0.0001	333216	{mai
n}( )	../json-rpc-service-demo.php:0

2	0.0001	333728	handle_json
_rpc( )	../json-rpc-service-demo.php:47

3	0.0003	336048	call_user_func_array
( )	../json-rpc.php:199

4	0.0003	336300	Demo
->ls( )	../json-rpc.php:199

{"jsonrpc":"2.0","result":["json-rpc-service-demo.php","mysql-rpc-demo.php","json-rpc.php","multiply-interpreters-demo.html","rpc-demo.html","tilda-demo.html"],
"id":1,"error":null}

It is displayed in red in the jquery terminal. After xdebug disable is added, the output is a lot smaller and more readable:

> ls
[AJAX] parsererror - Server reponse is:

Warning: Missing argument 2 for Demo::ls() in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 21

Notice: Undefined variable: path in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 23

Notice: Undefined variable: path in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 27

Notice: Undefined variable: path in /var/www/github/jquery.terminal/examples/json-rpc-service-demo.php on line 27

{"jsonrpc":"2.0","result":["json-rpc-service-demo.php","mysql-rpc-demo.php","json-rpc.php","multiply-interpreters-demo.html","rpc-demo.html","tilda-demo.html"],
"id":2,"error":null}

Missing arguments are another issue.