|
Revision 23810, 1.7 kB
(checked in by Kris.Wallsmith, 4 years ago)
|
[1.3] set svn:eol-style property to native and svn:keywords property to Id on all .php files
|
- 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 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 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 |
} |
|---|