本文整理汇总了PHP中BakeTask类的典型用法代码示例。如果您正苦于以下问题:PHP BakeTask类的具体用法?PHP BakeTask怎么用?PHP BakeTask使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BakeTask类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: getOptionParser
/**
* get the option parser.
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description(__d('cake_console', 'Bake models.'))->addArgument('name', array('help' => __d('cake_console', 'Name of the model to bake. Can use Plugin.name to bake plugin models.')))->addSubcommand('all', array('help' => __d('cake_console', 'Bake all model files with associations and validation.')))->addOption('plugin', array('short' => 'p', 'help' => __d('cake_console', 'Plugin to bake the model into.')))->addOption('connection', array('short' => 'c', 'help' => __d('cake_console', 'The connection the model table is on.')))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
}
示例3:
/**
* Override initialize
*
* @access public
*/
function __construct(&$dispatch)
{
parent::__construct($dispatch);
$this->path = $this->params['working'] . DS . 'tests' . DS . 'fixtures' . DS;
}
示例4: getOptionParser
/**
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->description(__d('cake_console', 'Bake a controller for a model. Using options you can bake public, admin or both.'))->addArgument('name', array('help' => __d('cake_console', 'Name of the controller to bake. Can use Plugin.name to bake controllers into plugins.')))->addOption('public', array('help' => __d('cake_console', 'Bake a controller with basic crud actions (index, view, add, edit, delete).'), 'boolean' => true))->addOption('admin', array('help' => __d('cake_console', 'Bake a controller with crud actions for one of the Routing.prefixes.'), 'boolean' => true))->addOption('plugin', array('short' => 'p', 'help' => __d('cake_console', 'Plugin to bake the controller into.')))->addOption('connection', array('short' => 'c', 'help' => __d('cake_console', 'The connection the controller\'s model is on.')))->addOption('theme', array('short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.')))->addOption('force', array('short' => 'f', 'help' => __d('cake_console', 'Force overwriting existing files without prompting.')))->addSubcommand('all', array('help' => __d('cake_console', 'Bake all controllers with CRUD methods.')))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
return $parser;
}
示例5: getOptionParser
/**
* Gets the option parser instance and configures it.
*
* @return ConsoleOptionParser
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
$parser->description(__d('cake_console', 'Bake test case skeletons for classes.'))->addArgument('type', array('help' => __d('cake_console', 'Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'), 'choices' => array('Controller', 'controller', 'Model', 'model', 'Helper', 'helper', 'Component', 'component', 'Behavior', 'behavior')))->addArgument('name', array('help' => __d('cake_console', 'An existing class to bake tests for.')))->addOption('theme', array('short' => 't', 'help' => __d('cake_console', 'Theme to use when baking code.')))->addOption('plugin', array('short' => 'p', 'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.')))->addOption('force', array('short' => 'f', 'help' => __d('cake_console', 'Force overwriting existing files without prompting.')))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
return $parser;
}
示例6: getOptionParser
/**
* get the option parser.
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->description(__('Bake test case skeletons for classes.'))->addArgument('type', array('help' => __('Type of class to bake, can be any of the following: controller, model, helper, component or behavior.'), 'choices' => array('controller', 'model', 'helper', 'component', 'behavior')))->addArgument('name', array('help' => __('An existing class to bake tests for.')))->addOption('plugin', array('short' => 'p', 'help' => __('CamelCased name of the plugin to bake tests for.')))->epilog(__('Omitting all arguments and options will enter into an interactive mode.'));
}
示例7: getOptionParser
/**
* get the option parser.
*
* @return void
*/
public function getOptionParser()
{
$parser = parent::getOptionParser();
return $parser->addOption('plugin', array('short' => 'l', 'help' => __d('cake_console', 'Plugin.')))->addOption('appTestCase', array('short' => 'z', 'help' => __d('cake_console', 'App test case.')))->addOption('noAppTestCase', array('short' => 'n', 'help' => __d('cake_console', 'App test case.')))->addOption('slug', array('short' => 's', 'boolean' => true, 'help' => __d('cake_console', 'Use slug.')))->addOption('parentSlug', array('short' => 'f', 'boolean' => true, 'help' => __d('cake_console', 'Use slug.')))->addOption('user', array('short' => 'u', 'help' => __d('cake_console', 'Use user model.')))->addOption('parent', array('short' => 'r', 'help' => __d('cake_console', 'Use parent model.')))->addOption('theme', array('short' => 't', 'help' => __d('cake_console', 'theme.')))->addOption('subthemes', array('short' => 'b', 'help' => __d('cake_console', 'subthemes.')))->addOption('property', array('short' => 'y', 'boolean' => true, 'help' => __d('cake_console', 'generate IDE properties hints for model relations')));
}