From 3052d68f9b562df38675219a0535656f69a7f518 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Thu, 6 Mar 2025 13:19:36 +0300 Subject: [PATCH] Restoring stuff --- internal.inc.php | 2 -- util.inc.php | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) 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; }