mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +00:00
Initializing tasks before execution (ticket #2725)
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5256 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
22ca7f3f3b
commit
eea7d7aafc
1 changed files with 10 additions and 3 deletions
|
@ -59,15 +59,15 @@ class BakeShell extends Shell {
|
||||||
switch($classToBake) {
|
switch($classToBake) {
|
||||||
case 'M':
|
case 'M':
|
||||||
$invalidSelection = false;
|
$invalidSelection = false;
|
||||||
$this->Model->execute();
|
$this->__executeTask($this->Model);
|
||||||
break;
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
$invalidSelection = false;
|
$invalidSelection = false;
|
||||||
$this->View->execute();
|
$this->__executeTask($this->View);
|
||||||
break;
|
break;
|
||||||
case 'C':
|
case 'C':
|
||||||
$invalidSelection = false;
|
$invalidSelection = false;
|
||||||
$this->Controller->execute();
|
$this->__executeTask($this->Controller);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$this->out('You have made an invalid selection. Please choose a type of class to Bake by entering M, V, or C.');
|
$this->out('You have made an invalid selection. Please choose a type of class to Bake by entering M, V, or C.');
|
||||||
|
@ -76,6 +76,13 @@ class BakeShell extends Shell {
|
||||||
$this->main();
|
$this->main();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function __executeTask($task) {
|
||||||
|
$task->initialize();
|
||||||
|
$task->loadTasks();
|
||||||
|
$task->startup();
|
||||||
|
$task->execute();
|
||||||
|
}
|
||||||
|
|
||||||
function help() {
|
function help() {
|
||||||
$this->out('CakePHP Bake:');
|
$this->out('CakePHP Bake:');
|
||||||
$this->hr();
|
$this->hr();
|
||||||
|
|
Loading…
Reference in a new issue