Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add backwards compatibility for removed methods

This stubs out subscribe_*() and enable_xml_dump()
  • Loading branch information...
commit 8bc4e02b4084fb80df4ac10859dca4d651677a1b 1 parent 7e6ae7c
@rmccue rmccue authored
Showing with 29 additions and 0 deletions.
  1. +29 −0 library/SimplePie.php
View
29 library/SimplePie.php
@@ -2954,6 +2954,35 @@ public function get_favicon()
}
/**
+ * Magic method handler
+ *
+ * @param string $method Method name
+ * @param array $args Arguments to the method
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (strpos($method, 'subscribe_') === 0)
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('subscribe_*() has been deprecated, implement the callback yourself', $level);
+ return '';
+ }
+ if ($method === 'enable_xml_dump')
+ {
+ $level = defined('E_USER_DEPRECATED') ? E_USER_DEPRECATED : E_USER_WARNING;
+ trigger_error('enable_xml_dump() has been deprecated, use get_raw_data() instead', $level);
+ return false;
+ }
+
+ $class = get_class($this);
+ $trace = debug_backtrace();
+ $file = $trace[0]['file'];
+ $line = $trace[0]['line'];
+ trigger_error("Call to undefined method $class::$method() in $file on line $line", E_USER_ERROR);
+ }
+
+ /**
* Sorting callback for items
*
* @access private
Please sign in to comment.
Something went wrong with that request. Please try again.