Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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
 * Generates a graphviz chart of current object model.
15
 *
16
 * @package    symfony
17
 * @subpackage propel
18
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
19
 * @version    SVN: $Id: sfPropelGraphvizTask.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
20
 */
21
class sfPropelGraphvizTask extends sfPropelBaseTask
22
{
23
  /**
24
   * @see BaseTask::configure()
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->namespace = 'propel';
33
    $this->name = 'graphviz';
34
    $this->briefDescription = 'Generates a graphviz chart of current object model';
35
    $this->detailedDescription = <<<EOF
36
The [propel:graphviz|INFO] task creates a graphviz DOT
37
visualization for automatic graph drawing of object model:
38
 
39
  [./symfony propel:graphviz|INFO]
40
EOF;
41
  }
42
 
43
  /**
44
   * @see BaseTask::execute()
45
   */
46
  protected function execute($arguments = array(), $options = array())
47
  {
48
    $this->schemaToXML(self::DO_NOT_CHECK_SCHEMA, 'generated-');
49
    $this->copyXmlSchemaFromPlugins('generated-');
50
    $ret = $this->callPhing('graphviz', self::CHECK_SCHEMA);
51
    $this->cleanup();
52
 
53
    return !$ret;
54
  }
55
}