Removing dead options.

This commit is contained in:
mark_story 2009-05-14 23:33:10 -04:00
parent 68a858b39a
commit b1de3166e9

View file

@ -149,29 +149,29 @@ class ControllerTask extends Shell {
} }
$doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y'); $doItInteractive = $this->in(join("\n", $question), array('y','n'), 'y');
if (low($doItInteractive) == 'y' || low($doItInteractive) == 'yes') { if (strtolower($doItInteractive) == 'y') {
$this->interactive = true; $this->interactive = true;
$wannaUseScaffold = $this->in(__("Would you like to use scaffolding?", true), array('y','n'), 'n'); $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'); $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'); $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'); $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)); $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); $helpersListTrimmed = str_replace(' ', '', $helpersList);
$helpers = explode(',', $helpersListTrimmed); $helpers = explode(',', $helpersListTrimmed);
} }
$wannaDoComponents = $this->in(__("Would you like this controller to use any components?", true), array('y','n'), 'n'); $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)); $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); $componentsListTrimmed = str_replace(' ', '', $componentsList);
$components = explode(',', $componentsListTrimmed); $components = explode(',', $componentsListTrimmed);
@ -184,17 +184,17 @@ class ControllerTask extends Shell {
} else { } else {
$wannaDoScaffolding = $this->in(__("Would you like to include some basic class methods (index(), add(), view(), edit())?", true), array('y','n'), 'y'); $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'); $wannaDoAdmin = $this->in(__("Would you like to create the methods for admin routing?", true), array('y','n'), 'y');
} }
} }
$admin = false; $admin = false;
if ((low($wannaDoAdmin) == 'y' || low($wannaDoAdmin) == 'yes')) { if (strtolower($wannaDoAdmin) == 'y') {
$admin = $this->getAdmin(); $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'))); $actions = $this->bakeActions($controllerName, null, in_array(low($wannaUseSession), array('y', 'yes')));
if ($admin) { if ($admin) {
$actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes'))); $actions .= $this->bakeActions($controllerName, $admin, in_array(low($wannaUseSession), array('y', 'yes')));
@ -208,7 +208,7 @@ class ControllerTask extends Shell {
$this->hr(); $this->hr();
$this->out("Controller Name: $controllerName"); $this->out("Controller Name: $controllerName");
if (low($wannaUseScaffold) == 'y' || low($wannaUseScaffold) == 'yes') { if (strtolower($wannaUseScaffold) == 'y') {
$this->out(" var \$scaffold;"); $this->out(" var \$scaffold;");
$actions = 'scaffold'; $actions = 'scaffold';
} }
@ -239,7 +239,7 @@ class ControllerTask extends Shell {
$this->hr(); $this->hr();
$looksGood = $this->in(__('Look okay?', true), array('y','n'), 'y'); $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); $baked = $this->bake($controllerName, $actions, $helpers, $components, $uses);
if ($baked && $this->_checkUnitTest()) { if ($baked && $this->_checkUnitTest()) {
$this->bakeTest($controllerName); $this->bakeTest($controllerName);