From b1de3166e948684b30acd3659f6a5801f5677bfc Mon Sep 17 00:00:00 2001 From: mark_story Date: Thu, 14 May 2009 23:33:10 -0400 Subject: [PATCH] Removing dead options. --- cake/console/libs/tasks/controller.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cake/console/libs/tasks/controller.php b/cake/console/libs/tasks/controller.php index 9ea0a81a4..0f11c7e84 100644 --- a/cake/console/libs/tasks/controller.php +++ b/cake/console/libs/tasks/controller.php @@ -149,29 +149,29 @@ class ControllerTask extends Shell { } $doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y'); - if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') { + if (strtolower($doItInteractive) == 'y') { $this->interactive = true; $wannaUseScaffold = $this->in(__("Would you like to use scaffolding?", true), array('y','n'), 'n'); - if (low($wannaUseScaffold) == 'n' || low($wannaUseScaffold) == 'no') { + if (strtolower($wannaUseScaffold) == 'n') { $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'n'); - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'n'); } $wannaDoHelpers = $this->in(__("Would you like this controller to use other helpers besides HtmlHelper and FormHelper?", true), array('y','n'), 'n'); - if (low($wannaDoHelpers) == 'y' || low($wannaDoHelpers) == 'yes') { + if (strtolower($wannaDoHelpers) == 'y') { $helpersList = $this->in(__("Please provide a comma separated list of the other helper names you'd like to use.\nExample: 'Ajax, Javascript, Time'", true)); $helpersListTrimmed = str_replace(' ', '', $helpersList); $helpers = explode(',', $helpersListTrimmed); } $wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); - if (low($wannaDoComponents) == 'y' || low($wannaDoComponents) == 'yes') { + if (strtolower($wannaDoComponents) == 'y') { $componentsList = $this->in(__("Please provide a comma separated list of the component names you'd like to use.\nExample: 'Acl, Security, RequestHandler'", true)); $componentsListTrimmed = str_replace(' ', '', $componentsList); $components = explode(',', $componentsListTrimmed); @@ -184,17 +184,17 @@ class ControllerTask extends Shell { } else { $wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'y'); - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'y'); } } $admin = false; - if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { + if (strtolower($wannaDoAdmin) == 'y') { $admin = $this->getAdmin(); } - if (low($wannaDoScaffolding) == 'y' || low($wannaDoScaffolding) == 'yes') { + if (strtolower($wannaDoScaffolding) == 'y') { $actions = $this->bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes'))); if ($admin) { $actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes'))); @@ -208,7 +208,7 @@ class ControllerTask extends Shell { $this->hr(); $this->out("Controller Name: $controllerName"); - if (low($wannaUseScaffold) == 'y' || low($wannaUseScaffold) == 'yes') { + if (strtolower($wannaUseScaffold) == 'y') { $this->out(" var \$scaffold;"); $actions = 'scaffold'; } @@ -239,7 +239,7 @@ class ControllerTask extends Shell { $this->hr(); $looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); - if (low($looksGood) == 'y' || low($looksGood) == 'yes') { + if (strtolower($looksGood) == 'y') { $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses); if ($baked && $this->_checkUnitTest()) { $this->bakeTest($controllerName);