Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Update changelog, add some deprecated-method notices to the __call() …
Browse files Browse the repository at this point in the history
…method to ease upgrading from 2.0 to 2.1
  • Loading branch information
Shane Harter committed Sep 27, 2013
1 parent 9c3d628 commit d7180e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Core/Daemon.php
Expand Up @@ -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)
Expand Down
13 changes: 11 additions & 2 deletions 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

Expand All @@ -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')
Expand All @@ -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

0 comments on commit d7180e1

Please sign in to comment.