soy-php/doctrine-migrations-task

Doctrine Migrations task for Soy

0.1.0 2015-12-11 14:28 UTC

This package is not auto-updated.

Last update: 2024-10-26 19:32:22 UTC


README

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;