Development

/branches/1.3/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildSqlTask.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfPropelPlugin/lib/task/sfPropelBuildSqlTask.class.php

Revision 14299, 1.7 kB (checked in by dwhittle, 6 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  * This file is part of the symfony package.
5  * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 require_once(dirname(__FILE__).'/sfPropelBaseTask.class.php');
12
13 /**
14  * Create SQL for the current model.
15  *
16  * @package    symfony
17  * @subpackage propel
18  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
19  * @version    SVN: $Id$
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 ///// FIXME: must change the propel.ini based on databases.yml! as done in insert-sql
58     return !$ret;
59   }
60 }
61
Note: See TracBrowser for help on using the browser.