|
Revision 14213, 1.7 kB
(checked in by Jonathan.Wage, 4 years ago)
|
[1.2] sfDoctrinePlugin: fixes issue with application option in tasks (closes #5238)
|
- Property svn:keywords set to
Id Date Author Revision HeadURL
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
require_once(dirname(__FILE__).'/sfDoctrineBaseTask.class.php'); |
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
class sfDoctrineBuildSqlTask extends sfDoctrineBaseTask |
|---|
| 24 |
{ |
|---|
| 25 |
|
|---|
| 26 |
* @see sfTask |
|---|
| 27 |
*/ |
|---|
| 28 |
protected function configure() |
|---|
| 29 |
{ |
|---|
| 30 |
$this->addOptions(array( |
|---|
| 31 |
new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true), |
|---|
| 32 |
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'), |
|---|
| 33 |
)); |
|---|
| 34 |
|
|---|
| 35 |
$this->aliases = array('doctrine-build-sql'); |
|---|
| 36 |
$this->namespace = 'doctrine'; |
|---|
| 37 |
$this->name = 'build-sql'; |
|---|
| 38 |
$this->briefDescription = 'Creates SQL for the current model'; |
|---|
| 39 |
|
|---|
| 40 |
$this->detailedDescription = <<<EOF |
|---|
| 41 |
The [doctrine:build-sql|INFO] task creates SQL statements for table creation: |
|---|
| 42 |
|
|---|
| 43 |
[./symfony doctrine:build-sql|INFO] |
|---|
| 44 |
|
|---|
| 45 |
The generated SQL is optimized for the database configured in [config/databases.yml|COMMENT]: |
|---|
| 46 |
|
|---|
| 47 |
[doctrine.database = mysql|INFO] |
|---|
| 48 |
EOF; |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
* @see sfTask |
|---|
| 53 |
*/ |
|---|
| 54 |
protected function execute($arguments = array(), $options = array()) |
|---|
| 55 |
{ |
|---|
| 56 |
$this->logSection('doctrine', 'generating sql for models'); |
|---|
| 57 |
|
|---|
| 58 |
$databaseManager = new sfDatabaseManager($this->configuration); |
|---|
| 59 |
$this->callDoctrineCli('generate-sql'); |
|---|
| 60 |
} |
|---|
| 61 |
} |
|---|