本文整理汇总了PHP中BakeTask::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP BakeTask::execute方法的具体用法?PHP BakeTask::execute怎么用?PHP BakeTask::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BakeTask
的用法示例。
在下文中一共展示了BakeTask::execute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute()
{
parent::execute();
if (empty($this->args)) {
$this->_interactive();
}
if (!empty($this->args[0])) {
$this->interactive = false;
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) == 'all') {
return $this->all();
}
$model = $this->_modelName($this->args[0]);
$this->listAll($this->connection);
$useTable = $this->getTable($model);
$object = $this->_getModelObject($model, $useTable);
if ($this->bake($object, false)) {
if ($this->_checkUnitTest()) {
$this->bakeFixture($model, $useTable);
$this->bakeTest($model);
}
}
}
}
示例2: execute
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute()
{
parent::execute();
if (empty($this->args)) {
$this->_interactive();
}
if (count($this->args) == 1) {
$this->_interactive($this->args[0]);
}
if (count($this->args) > 1) {
$type = Inflector::classify($this->args[0]);
if ($this->bake($type, $this->args[1])) {
$this->out('<success>Done</success>');
}
}
}
示例3: execute
/**
* Execution method always used for tasks
* Handles dispatching to interactive, named, or all processes.
*
* @return void
*/
public function execute()
{
parent::execute();
if (empty($this->args)) {
$this->_interactive();
}
if (isset($this->args[0])) {
$this->interactive = false;
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) === 'all') {
return $this->all();
}
$model = $this->_modelName($this->args[0]);
$this->bake($model);
}
}
示例4: execute
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute() {
parent::execute();
if (empty($this->args)) {
return $this->_interactive();
}
if (isset($this->args[0])) {
if (!isset($this->connection)) {
$this->connection = 'default';
}
if (strtolower($this->args[0]) === 'all') {
return $this->all();
}
$controller = $this->_controllerName($this->args[0]);
$actions = '';
if (!empty($this->params['public'])) {
$this->out(__d('cake_console', 'Baking basic crud methods for ') . $controller);
$actions .= $this->bakeActions($controller);
}
if (!empty($this->params['admin'])) {
$admin = $this->Project->getPrefix();
if ($admin) {
$this->out(__d('cake_console', 'Adding %s methods', $admin));
$actions .= "\n" . $this->bakeActions($controller, $admin);
}
}
if (empty($actions)) {
$actions = 'scaffold';
}
if ($this->bake($controller, $actions)) {
if ($this->_checkUnitTest()) {
$this->bakeTest($controller);
}
}
}
}
示例5: execute
/**
* Execution method always used for tasks
*
* @return void
*/
public function execute()
{
parent::execute();
}