Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.79 KB

File metadata and controls

52 lines (40 loc) · 1.79 KB

Doctrine Migrations Task

Latest Stable Version Total Downloads Latest Unstable Version License

Introduction

This is a Doctrine Migrations task for Soy

Usage

Include soy-php/doctrine-migrations-task in your project with composer:

$ composer require soy-php/doctrine-migrations-task

Standalone

In your recipe you can use the task as follows:

<?php

$recipe = new \Soy\Recipe();

$recipe->component('default', function (\Soy\DoctrineMigrations\MigrateTask $migrateTask) {
    $migrateTask
        ->setBinary('./vendor/bin/doctrine-migrations')
        ->setCommandNamespace('migrations:')
        ->setConfiguration('migrations.yml')
        ->setDbConfiguration('db.php')
        ->setVerbose(true)
        ->run();
});

return $recipe;

Symfony

When using Doctrine in combination with Symfony, you can use the following setup:

<?php

$recipe = new \Soy\Recipe();

$recipe->component('default', function (\Soy\DoctrineMigrations\MigrateTask $migrateTask) {
    $migrateTask
        ->setBinary('./bin/console')
        ->setCommandNamespace('doctrine:migrations:')
        ->addArgument('-e dev')
        ->setVerbose(true)
        ->run();
});

return $recipe;