Closed WinterSilence closed 10 years ago
Houston, we have a problem! I sent requests from another computer. how to change these requests?
@WinterSilence which requests, what seems to be the problem?
my local version does not include these changes. how to add them?
understood, i'm stupid :)
I'm not sure you can do that since you removed your github repo. I'll merge this as-is and you can pull from kohana/3.4/develop
, fix the remaining things and send another pull request for the fixes.
Nobody is stupid here :)
@WinterSilence that documentation you linked to is inconsistent. The code sample shows $this->options
but the text immediately below still refers to taking a $params
array.
To be honest, I'm with @cyrgit on this, I don't see any good reason for this breaking change, which is the second I'm aware of (removing ::password
being the other) that was introduced in a "typos and bugs" pull request. These really shouldn't have been merged without being split into separate commits with proper messages explaining what was changed, why and the implications.
API breaking changes should not be allowed when there is no good reason for it. This just seems like a unilateral decision that was pushed in with the general refactor. Why should I go and update all my Tasks to accommodate for this? Minion was running fine before it. Refactors are good for cleaning up the code, typos, and creating efficiency. If the API is to be changed, it should be a consensus decision, and be made a separate commit from a cleaning refactor.
@acoulton @cyrgit if we return attribute $params
is only confuse users because values contained in $this->_options
. I will correct the code, if accepted by a few developers.
New version of Kohana will be very different from the previous, so full compatibility is not guaranteed. We must make a choice between backward compatibility and new user-friendly codes.
@WinterSilence I don't think it will confuse users to have the $params array in _execute(), as that is the way it has always run. Confusing is to discover your several dozens of Tasks don't run anymore due to a breaking change hidden in a "typos" refactor.
On a separate issue from this PR, which shouldn't mix feature requests or breaking changes:
I think the best design for this would actually be to keep a separation between defaults and runtime parameters. Such that $this->options never changes, and whatever is passed in CLI gets sent in through $params.
This allows _execute() to distinguish if the Task is being run with default parameters, or ones sent by the user. When set_options() runs, it overwrites the original defaults the class had defined, making it impossible to know what the default was.
@WinterSilence There is already a PR for this pending, no need to duplicate
I will merge this as soon as these few small finesses are fixed. Good job!