diff --git a/internal.inc.php b/internal.inc.php index d3bcfa6..8c5bb64 100644 --- a/internal.inc.php +++ b/internal.inc.php @@ -97,8 +97,6 @@ function _get_task_candidates() //get tasks defined as closures foreach($TASKMAN_CLOSURES as $name => $args) { - if(isset($cands[$name])) - throw new Exception("Task '$name' is already defined"); $cands[$name] = $args; } diff --git a/util.inc.php b/util.inc.php index dca1f89..f880366 100644 --- a/util.inc.php +++ b/util.inc.php @@ -74,6 +74,9 @@ function task($name) { global $TASKMAN_CLOSURES; + if(isset($TASKMAN_CLOSURES[$name])) + throw new TaskmanException("Task '$name' is already defined"); + $args = func_get_args(); $TASKMAN_CLOSURES[$name] = $args; }