Development

/branches/1.3/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildAllTask.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfDoctrinePlugin/lib/task/sfDoctrineBuildAllTask.class.php

Revision 24849, 3.1 kB (checked in by fabien, 4 years ago)

[1.3] fixed typo (closes #7778)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6  * (c) Jonathan H. Wage <jonwage@gmail.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 require_once(dirname(__FILE__).'/sfDoctrineBaseTask.class.php');
13
14 /**
15  * Generates Doctrine model, SQL and initializes the database.
16  *
17  * @package    symfony
18  * @subpackage doctrine
19  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
20  * @author     Jonathan H. Wage <jonwage@gmail.com>
21  * @version    SVN: $Id$
22  *
23  * @deprecated Use doctrine:build instead
24  */
25 class sfDoctrineBuildAllTask extends sfDoctrineBaseTask
26 {
27   /**
28    * @see sfTask
29    */
30   protected function configure()
31   {
32     $this->addOptions(array(
33       new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
34       new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
35       new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Do not ask for confirmation'),
36       new sfCommandOption('skip-forms', 'F', sfCommandOption::PARAMETER_NONE, 'Skip generating forms'),
37       new sfCommandOption('migrate', null, sfCommandOption::PARAMETER_NONE, 'Migrate instead of reset the database'),
38     ));
39  
40     $this->aliases = array('doctrine-build-all');
41     $this->namespace = 'doctrine';
42     $this->name = 'build-all';
43     $this->briefDescription = 'Generates Doctrine model, SQL and initializes the database';
44
45     $this->detailedDescription = <<<EOF
46 The [doctrine:build-all|INFO] task is a shortcut for four other tasks:
47
48   [./symfony doctrine:build-all|INFO]
49
50 The task is equivalent to:
51
52   [./symfony doctrine:build-model|INFO]
53   [./symfony doctrine:build-sql|INFO]
54   [./symfony doctrine:build-forms|INFO]
55   [./symfony doctrine:insert-sql|INFO]
56
57 See those four tasks help page for more information.
58
59 To bypass the confirmation, you can pass the [no-confirmation|COMMENT]
60 option:
61
62   [./symfony doctrine:buil-all-load --no-confirmation|INFO]
63
64 Include the [--migrate|COMMENT] option if you would like to run your project's
65 migrations rather than inserting the Doctrine SQL.
66
67   [./symfony doctrine:build-all --migrate|INFO]
68
69 This is equivalent to:
70
71   [./symfony doctrine:build-model|INFO]
72   [./symfony doctrine:build-sql|INFO]
73   [./symfony doctrine:build-forms|INFO]
74   [./symfony doctrine:migrate|INFO]
75 EOF;
76   }
77
78   /**
79    * @see sfTask
80    */
81   protected function execute($arguments = array(), $options = array())
82   {
83     $task = new sfDoctrineBuildTask($this->dispatcher, $this->formatter);
84     $task->setCommandApplication($this->commandApplication);
85     $task->setConfiguration($this->configuration);
86     $ret = $task->run(array(), array(
87       'no-confirmation' => $options['no-confirmation'],
88       'db'              => true,
89       'model'           => true,
90       'forms'           => !$options['skip-forms'],
91       'filters'         => !$options['skip-forms'],
92       'sql'             => true,
93       'and-migrate'     => $options['migrate'],
94     ));
95
96     return $ret;
97   }
98 }
99
Note: See TracBrowser for help on using the browser.