Skip to content

Commit

Permalink
WIP - more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gggeek committed Dec 15, 2014
1 parent 9e9427b commit 62a0db8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions demo/server/discuss.php
@@ -1,5 +1,7 @@
<?php

include_once(__DIR__."/../../vendor/autoload.php");

include_once(__DIR__."/../../lib/xmlrpc.inc");
include_once(__DIR__."/../../lib/xmlrpcs.inc");

Expand Down
2 changes: 2 additions & 0 deletions demo/server/proxy.php
Expand Up @@ -9,6 +9,8 @@
* @license code licensed under the BSD License: http://phpxmlrpc.sourceforge.net/license.txt
*/

include_once(__DIR__."/../../vendor/autoload.php");

include_once(__DIR__."/../../lib/xmlrpc.inc");
include_once(__DIR__."/../../lib/xmlrpcs.inc");

Expand Down
13 changes: 9 additions & 4 deletions src/Server.php
Expand Up @@ -23,7 +23,7 @@ function _xmlrpcs_errorHandler($errcode, $errstring, $filename=null, $lineno=nul
//if($errcode != E_NOTICE && $errcode != E_WARNING && $errcode != E_USER_NOTICE && $errcode != E_USER_WARNING)
if($errcode != E_STRICT)
{
$GLOBALS['_xmlrpcs_occurred_errors'] = $GLOBALS['_xmlrpcs_occurred_errors'] . $errstring . "\n";
\PhpXmlRpc\Server::error_occurred($errstring);
}
// Try to avoid as much as possible disruption to the previous error handling
// mechanism in place
Expand Down Expand Up @@ -118,7 +118,7 @@ class Server
var $user_data = null;

static protected $_xmlrpc_debuginfo = '';
static $_xmlrpcs_occurred_errors = '';
static protected $_xmlrpcs_occurred_errors = '';
static $_xmlrpcs_prev_ehandler = '';

/**
Expand Down Expand Up @@ -188,6 +188,11 @@ public static function xmlrpc_debugmsg($m)
static::$_xmlrpc_debuginfo .= $m . "\n";
}

public static function error_occurred($m)
{
static::$_xmlrpcs_occurred_errors .= $m . "\n";
}

/**
* Return a string with the serialized representation of all debug info
* @param string $charset_encoding the target charset encoding for the serialization
Expand Down Expand Up @@ -249,10 +254,10 @@ function service($data=null, $return_payload=false)
// save full body of request into response, for more debugging usages
$r->raw_data = $raw_data;

if($this->debug > 2 && $GLOBALS['_xmlrpcs_occurred_errors'])
if($this->debug > 2 && static::$_xmlrpcs_occurred_errors)
{
$this->debugmsg("+++PROCESSING ERRORS AND WARNINGS+++\n" .
$GLOBALS['_xmlrpcs_occurred_errors'] . "+++END+++");
static::$_xmlrpcs_occurred_errors . "+++END+++");
}

$payload=$this->xml_header($resp_charset);
Expand Down

0 comments on commit 62a0db8

Please sign in to comment.