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) 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
/**
13
 * sfDoctrineCli
14
 *
15
 * @package    symfony
16
 * @subpackage doctrine
17
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
18
 * @author     Jonathan H. Wage <jonwage@gmail.com>
19
 * @version    SVN: $Id: sfDoctrineCli.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
20
 */
21
class sfDoctrineCli extends Doctrine_Cli
22
{
23
  protected $symfonyDispatcher,
24
            $symfonyFormatter;
25
 
26
  /**
27
   * Set the symfony dispatcher of the cli instance
28
   *
29
   * @param object $dispatcher
30
   * @return void
31
   */
32
  public function setSymfonyDispatcher($dispatcher)
33
  {
34
    $this->symfonyDispatcher = $dispatcher;
35
  }
36
 
37
  /**
38
   * Set the symfony formatter to use for the cli
39
   *
40
   * @param object $formatter
41
   * @return void
42
   */
43
  public function setSymfonyFormatter($formatter)
44
  {
45
    $this->symfonyFormatter = $formatter;
46
  }
47
 
48
  /**
49
   * Notify the dispatcher of a message. We silent the messages from the Doctrine cli.
50
   *
51
   * @param string $notification
52
   * @param string $style
53
   * @return false
54
   */
55
  public function notify($notification = null, $style = 'HEADER')
56
  {
57
    $this->symfonyDispatcher->notify(new sfEvent($this, 'command.log', array($this->symfonyFormatter->formatSection('doctrine', $notification))));
58
  }
59
 
60
  /**
61
   * Notify symfony of an exception thrown by the Doctrine cli
62
   *
63
   * @param Doctrine_Exception $exception
64
   * @return void
65
   * @throws sfException
66
   */
67
  public function notifyException(Exception $exception)
68
  {
69
    throw $exception;
70
  }
71
}