From d7180e1bf9ccf8db6576ac4dcd40a671f24c4e47 Mon Sep 17 00:00:00 2001 From: Shane Harter Date: Fri, 27 Sep 2013 13:13:27 -0700 Subject: [PATCH] Update changelog, add some deprecated-method notices to the __call() method to ease upgrading from 2.0 to 2.1 --- Core/Daemon.php | 5 +++++ changelog | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Core/Daemon.php b/Core/Daemon.php index dec63fc..86f8e7a 100755 --- a/Core/Daemon.php +++ b/Core/Daemon.php @@ -378,6 +378,11 @@ public function __destruct() */ public function __call($method, $args) { + $deprecated = array('shutdown', 'verbose', 'is_daemon', 'filename'); + if (in_array($method, $deprecated)) { + throw new Exception("Deprecated method call: $method(). Update your code to use the v2.1 get(), set() and is() methods."); + } + $accessors = array('loop_interval', 'pid'); if (in_array($method, $accessors)) { if ($args) diff --git a/changelog b/changelog index 8c03893..715d087 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,13 @@ +Non-Backwards Compatible Changes: +(If upgrading from 1.x or 2.0, you will need to apply these changes) +- Remove any calls to Daemon::setFilename(). The filename is now determined programmatically. +- Replace any calls to Daemon::filename() with Daemon::get('filename') +- Replace any calls to Daemon::verbose() with Daemon::is('verbose') +- Replace any calls to Daemon::shutdown() with Daemon::is('shutdown') +- If you have any classes that implement Core_ITask you must add the method "group()" to those classes. (Returning an empty string is fine) + +(Note that is() and get() are aliases of the same method. The convention is to use is() when calling a boolean value.) + Application-Wide changes: - Instance variable $is_parent is removed from several classes in favor of reading the 'parent' env variable @@ -10,7 +20,7 @@ Changes to the Core_Worker API - Debug command 'show local' is removed. Changes to the Core_Daemon API -- Static method setFilename() renamed to set_filename() for consistency. +- Static method setFilename() removed. - Static method set() created to set application-wide environment variables. - Static method get() created to read application-wide environment variables. - Static method filename() removed, you can read the filename using Core_Daemon::get('filename') @@ -26,6 +36,5 @@ Changes to the Core_Daemon API Changes to the Core_ITask API - New instance method added to the interface: group(). - To Do: - Consider what other vars we can move into the $env dictionary instead of thier own instance vas in Core_Daemon \ No newline at end of file