From a81d57a0803a02cf9df1d7ef9723540ddaee522d Mon Sep 17 00:00:00 2001 From: Juan Basso Date: Sun, 17 Jan 2010 03:29:39 -0200 Subject: [PATCH] Changing the class name to lowercase before ordering the ClassRegistry in PHP 4 to not have problems of duplication of tasks in the shell. Fixes #186. --- cake/console/libs/shell.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/shell.php b/cake/console/libs/shell.php index 63335efd7d5..c4d6c212d8a 100644 --- a/cake/console/libs/shell.php +++ b/cake/console/libs/shell.php @@ -293,12 +293,16 @@ function loadTasks() { } } } - if (ClassRegistry::isKeySet($taskClass)) { + $taskClassCheck = $taskClass; + if (!PHP5) { + $taskClassCheck = strtolower($taskClass); + } + if (ClassRegistry::isKeySet($taskClassCheck)) { $this->taskNames[] = $taskName; if (!PHP5) { - $this->{$taskName} =& ClassRegistry::getObject($taskClass); + $this->{$taskName} =& ClassRegistry::getObject($taskClassCheck); } else { - $this->{$taskName} = ClassRegistry::getObject($taskClass); + $this->{$taskName} = ClassRegistry::getObject($taskClassCheck); } } else { $this->taskNames[] = $taskName;