The decision to use stderr or extmodule's %%>output for debugging PHP can be overriden via Yate::Output(boolean).

git-svn-id: http://yate.null.ro/svn/yate/trunk@2997 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2009-12-21 12:00:34 +00:00
parent a4e2f58dbd
commit d04e8205a7
1 changed files with 10 additions and 3 deletions

View File

@ -56,8 +56,12 @@ class Yate
*/
static function Output($str)
{
global $yate_stderr, $yate_socket;
if ($yate_socket)
global $yate_stderr, $yate_output;
if ($str === true)
$yate_output = true;
else if ($str === false)
$yate_output = false;
else if ($yate_output)
_yate_print("%%>output:$str\n");
else
fputs($yate_stderr, "$str\n");
@ -429,11 +433,13 @@ class Yate
*/
static function Init($async = false, $addr = "", $port = 0, $role = "")
{
global $yate_stdin, $yate_stdout, $yate_stderr, $yate_socket, $yate_debug;
global $yate_stdin, $yate_stdout, $yate_stderr;
global $yate_socket, $yate_debug, $yate_output;
$yate_debug = false;
$yate_stdin = false;
$yate_stdout = false;
$yate_stderr = false;
$yate_output = false;
if ($addr) {
$ok = false;
if ($port) {
@ -450,6 +456,7 @@ class Yate
Yate::Output("Socket error, initialization failed");
return false;
}
$yate_output = true;
}
else {
$yate_socket = false;