Fixing bug related to possible re-define of tasks
Publish PHP Package / docker (push) Successful in 9s
Details
Publish PHP Package / docker (push) Successful in 9s
Details
This commit is contained in:
parent
37c915e72e
commit
4cf34b0dba
|
@ -293,11 +293,7 @@ function _get_task_candidates()
|
||||||
|
|
||||||
//get tasks defined as closures
|
//get tasks defined as closures
|
||||||
foreach($TASKMAN_CLOSURES as $name => $args)
|
foreach($TASKMAN_CLOSURES as $name => $args)
|
||||||
{
|
|
||||||
if(isset($cands[$name]))
|
|
||||||
throw new Exception("Task '$name' is already defined");
|
|
||||||
$cands[$name] = $args;
|
$cands[$name] = $args;
|
||||||
}
|
|
||||||
|
|
||||||
ksort($cands);
|
ksort($cands);
|
||||||
|
|
||||||
|
@ -385,6 +381,10 @@ function task($name)
|
||||||
{
|
{
|
||||||
global $TASKMAN_CLOSURES;
|
global $TASKMAN_CLOSURES;
|
||||||
|
|
||||||
|
//TODO: can it be a feature?
|
||||||
|
if(isset($TASKMAN_CLOSURES[$name]))
|
||||||
|
throw new TaskmanException("Task '$name' is already defined");
|
||||||
|
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
$TASKMAN_CLOSURES[$name] = $args;
|
$TASKMAN_CLOSURES[$name] = $args;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue