summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-27 12:38:28 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-10-27 12:41:10 (GMT)
commitce012f5faec11cd288b8b58beb82a0257d412590 (patch)
tree1e24e33a4fa5fc54c974c2454792ac5096ae77da
parentf9f48f509d143c6b137b457e5940727745857446 (diff)
downloadNet_IMAP4-ce012f5faec11cd288b8b58beb82a0257d412590.tar.gz
Issue an actual deprecation warning, and issue an error should no such method or static exist (return null)
-rw-r--r--lib/Net/IMAP4.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/Net/IMAP4.php b/lib/Net/IMAP4.php
index deee0b3..e87bb9a 100644
--- a/lib/Net/IMAP4.php
+++ b/lib/Net/IMAP4.php
@@ -190,24 +190,34 @@
function __call($name, $args) {
if (array_key_exists($name, self::$compat_func)) {
error_log(
- "Calling $name is deprecated in favor of " .
- self::$compat_func[$name]
+ "Deprecation warning: Use of $name is deprecated in " .
+ "favor of " . self::$compat_func[$name]
);
- return call_user_func_array(array($this, self::$compat_func[$name]), $args);
+ return call_user_func_array(
+ Array($this, self::$compat_func[$name]),
+ $args
+ );
} else {
+ error_log("Call to undefined method " . $name);
+ return null;
}
}
public static function __callStatic($name, $args) {
if (array_key_exists($name, self::$compat_func)) {
error_log(
- "Calling $name is deprecated in favor of " .
- self::$compat_func[$name]
+ "Deprecation warning: Calling $name is deprecated in " .
+ "favor of " . self::$compat_func[$name]
);
- return call_user_func_array(array(self, self::$compat_func[$name]), $args);
+ return call_user_func_array(
+ Array(self, self::$compat_func[$name]),
+ $args);
+
} else {
+ error_log("Call to undefined static " . $name);
+ return null;
}
}