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');
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);