| 1 | <?php |
||
| 11 | class ComposerScripter extends ScriptHandler |
||
| 12 | { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Clears the Symfony cache. |
||
| 16 | */ |
||
| 17 | public static function loadFixtures(Event $event) |
||
| 18 | { |
||
| 19 | $consoleDir = static::getConsoleDir($event, 'Load fixtures to database'); |
||
| 20 | |||
| 21 | static::executeCommand($event, $consoleDir, 'rock:fixture:load'); |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Creating database |
||
| 26 | */ |
||
| 27 | public static function createDatabase(Event $event) |
||
| 28 | { |
||
| 29 | $consoleDir = static::getConsoleDir($event, 'Creates the configured database'); |
||
| 30 | |||
| 31 | static::executeCommand($event, $consoleDir, 'doctrine:database:create --if-not-exists'); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Update database schema |
||
| 36 | */ |
||
| 37 | public static function updateDatabaseSchema(Event $event) |
||
| 38 | { |
||
| 39 | $consoleDir = static::getConsoleDir($event, 'Creates the configured database'); |
||
| 40 | |||
| 41 | static::executeCommand($event, $consoleDir, 'doctrine:schema:update --force'); |
||
| 42 | } |
||
| 43 | } |
||
| 44 |