is now static
- new methods in helper classes: `Charset::knownCharsets`, `Http::parseAcceptHeader`, `XMLParser::truncateValueForLog`
- new method `Response::xml_header` has replaced `Server::xml_header`
+ - protected property `Server::$accepted_charset_encodings` is now deprecated
- exception `\PhpXmlRpc\Exception\PhpXmlRpcException` is deprecated. Use `\PhpXmlRpc\Exception` instead
| Response | errstr | faultString | __construct |
| Response | content_type | getContentType | setPayload |
| Response | payload | getPayload | setPayload |
-| Server | accepted_charset_encodings | - | - |
| Server | accepted_compression | getOption | setOption |
| Server | allow_system_funcs | getOption | setOption |
| Server | compress_response | getOption | setOption |
| Value | mytype | kindOf | __construct |
| Wrapper | $objectholder | getHeldObject | holdObject |
| XMLParser | $_xh | results of parse() | - |
+
+The following previously protected properties are now deprecated for access by subclasses
+
+| Class | Property | Read via | Write via |
+|-----------|----------------------------|------------------------|----------------------------------|
+| Request | httpResponse | - | - |
+| Server | accepted_charset_encodings | - | - |
/**
* holds data while parsing the response. NB: Not a full Response object
- * @deprecated will be removed in a future release
+ * @deprecated will be removed in a future release; still accessible by subclasses for the moment
*/
- protected $httpResponse = array();
+ private $httpResponse = array();
/**
* @param string $methodName the name of the method to invoke
case 'content_type':
$this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
return $this->$name;
+ case 'httpResponse':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Request')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
+ return $this->httpResponse;
+ } else {
+ trigger_error("Cannot access protected property Request::httpResponse in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
$this->$name = $value;
break;
+ case 'httpResponse':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Request')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
+ $this->httpResponse = $value;
+ } else {
+ trigger_error("Cannot access protected property Request::httpResponse in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
case 'content_type':
$this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
return isset($this->$name);
+ case 'httpResponse':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Request')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
+ return isset($this->httpResponse);
+ }
+ // break through voluntarily
default:
return false;
}
$this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
unset($this->$name);
break;
+ case 'httpResponse':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Request')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
+ unset($this->httpResponse);
+ } else {
+ trigger_error("Cannot access protected property Request::httpResponse in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
/**
* List of charset encodings natively accepted for requests.
* Set at constructor time.
- * @deprecated UNUSED so far...
+ * @deprecated UNUSED so far by this library. It is still accessible by subclasses but will be dropped in the future.
*/
- protected $accepted_charset_encodings = array();
+ private $accepted_charset_encodings = array();
/**
* @var string
public function addToMap($methodName, $function, $sig = null, $doc = false, $sigDoc = false, $parametersType = false,
$exceptionHandling = false)
{
- return $this->addToMap($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
+ $this->add_to_map($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
}
/**
case self::OPT_RESPONSE_CHARSET_ENCODING:
$this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
return $this->$name;
+ case 'accepted_charset_encodings':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Server')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
+ return $this->accepted_compression;
+ } else {
+ trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
$this->$name = $value;
break;
+ case 'accepted_charset_encodings':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Server')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
+ $this->accepted_compression = $value;
+ } else {
+ trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
case self::OPT_RESPONSE_CHARSET_ENCODING:
$this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
return isset($this->$name);
+ case 'accepted_charset_encodings':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Server')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
+ return isset($this->accepted_compression);
+ }
+ // break through voluntarily
default:
return false;
}
$this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
unset($this->$name);
break;
+ case 'accepted_charset_encodings':
+ // manually implement the 'protected property' behaviour
+ $canAccess = false;
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
+ if (isset($trace[1]) && isset($trace[1]['class'])) {
+ if (is_subclass_of($trace[1]['class'], 'PhpXmlRpc\Server')) {
+ $canAccess = true;
+ }
+ }
+ if ($canAccess) {
+ $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
+ unset($this->accepted_compression);
+ } else {
+ trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
+ }
+ break;
default:
/// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);