0
我想知道是否可以在Shell和它的任务之间共享代码(函数和变量)。例如,假设我有以下几点:CakePHP在Shell和它的任务之间共享代码
Class MyShell extends Shell{
var $tasks = array('MyTask');
var $someVariable;
function someFunction(){}
}
,然后在我的任务:
class MyTask extends Shell {
//somehow access the someFunction() and $someVariable in here
}
这可能吗?此外,无论是否是,这是不是推荐的蛋糕方式?谢谢!
哦哇,这么明显......谢谢! – kurisukun