|
Revision 14299, 1.7 kB
(checked in by dwhittle, 4 years ago)
|
sfPropelPlugin: reverted r14297
|
- Property svn:mime-type set to
text/x-php
- Property svn:eol-style set to
native
- Property svn:keywords set to
Id
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php'); |
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
class sfPropelBuildSqlTask extends sfPropelBaseTask |
|---|
| 22 |
{ |
|---|
| 23 |
|
|---|
| 24 |
* @see sfTask |
|---|
| 25 |
*/ |
|---|
| 26 |
protected function configure() |
|---|
| 27 |
{ |
|---|
| 28 |
$this->addOptions(array( |
|---|
| 29 |
new sfCommandOption('phing-arg', null, sfCommandOption::PARAMETER_REQUIRED | sfCommandOption::IS_ARRAY, 'Arbitrary phing argument'), |
|---|
| 30 |
)); |
|---|
| 31 |
|
|---|
| 32 |
$this->aliases = array('propel-build-sql'); |
|---|
| 33 |
$this->namespace = 'propel'; |
|---|
| 34 |
$this->name = 'build-sql'; |
|---|
| 35 |
$this->briefDescription = 'Creates SQL for the current model'; |
|---|
| 36 |
|
|---|
| 37 |
$this->detailedDescription = <<<EOF |
|---|
| 38 |
The [propel:build-sql|INFO] task creates SQL statements for table creation: |
|---|
| 39 |
|
|---|
| 40 |
[./symfony propel:build-sql|INFO] |
|---|
| 41 |
|
|---|
| 42 |
The generated SQL is optimized for the database configured in [config/propel.ini|COMMENT]: |
|---|
| 43 |
|
|---|
| 44 |
[propel.database = mysql|INFO] |
|---|
| 45 |
EOF; |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
* @see sfTask |
|---|
| 50 |
*/ |
|---|
| 51 |
protected function execute($arguments = array(), $options = array()) |
|---|
| 52 |
{ |
|---|
| 53 |
$this->schemaToXML(self::DO_NOT_CHECK_SCHEMA, 'generated-'); |
|---|
| 54 |
$this->copyXmlSchemaFromPlugins('generated-'); |
|---|
| 55 |
$ret = $this->callPhing('sql', self::CHECK_SCHEMA); |
|---|
| 56 |
$this->cleanup(); |
|---|
| 57 |
|
|---|
| 58 |
return !$ret; |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|