Development

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

You must first sign up to be able to contribute.

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

Revision 23810, 2.3 kB (checked in by Kris.Wallsmith, 5 years ago)

[1.3] set svn:eol-style property to native and svn:keywords property to Id on all .php files

  • 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  * Creates database for current model.
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 sfDoctrineRebuildDbTask 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, 'Whether to no-confirmation dropping of the database'),
36       new sfCommandOption('migrate', null, sfCommandOption::PARAMETER_NONE, 'Migrate instead of reset the database'),
37     ));
38
39     $this->aliases = array('doctrine-rebuild-db');
40     $this->namespace = 'doctrine';
41     $this->name = 'rebuild-db';
42     $this->briefDescription = 'Creates database for current model';
43
44     $this->detailedDescription = <<<EOF
45 The [doctrine:rebuild-db|INFO] task creates the database:
46
47   [./symfony doctrine:rebuild-db|INFO]
48
49 The task read connection information in [config/databases.yml|COMMENT]:
50
51 Include the [--migrate|COMMENT] option if you would like to run your application's
52 migrations rather than inserting the Doctrine SQL.
53
54   [./symfony doctrine:rebuild-db --migrate|INFO]
55 EOF;
56   }
57
58   /**
59    * @see sfTask
60    */
61   protected function execute($arguments = array(), $options = array())
62   {
63     $task = new sfDoctrineBuildTask($this->dispatcher, $this->formatter);
64     $task->setCommandApplication($this->commandApplication);
65     $task->setConfiguration($this->configuration);
66     $ret = $task->run(array(), array(
67       'no-confirmation' => $options['no-confirmation'],
68       'db'              => true,
69       'and-migrate'     => $options['migrate'],
70     ));
71
72     return $ret;
73   }
74 }
Note: See TracBrowser for help on using the browser.