2017 © Pedro Peláez
 

library ezpublish-migrations-bundle

Migrations for eZ Publish/eZ Platform

image

kreait/ezpublish-migrations-bundle

Migrations for eZ Publish/eZ Platform

  • Tuesday, April 26, 2016
  • by jeromegamez
  • Repository
  • 5 Watchers
  • 16 Stars
  • 6,123 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 0 Open issues
  • 17 Versions
  • 6 % Grown

The README.md

eZ Publish/Platform Migrations

Migrations for eZ Publish/Platform., (*1)

Abandoned/Archived: This bundle hasn't received updates since 2016, is far behind the current development of eZ Publish/Platform, and thus has been marked as archived/abandoned. Please switch to kaliop/ezmigrationbundle., (*2)

Features

In addition to the commands from the DoctrineMigrationsBundle, this bundle gives you an additional ezpublish:migrations:generate command, which generates a Migration that eases eZ Publish/Platform related changes., (*3)

  • Automatically sets the active eZ user performing the changes (default: admin)
  • Allows the quick change of the currently active user, e.g. for creating new content in the name of a certain user.
  • Adds a shorthand method to create new content

If you know Doctrine Migrations, you will feel right at home., (*4)

Installation

composer require kreait/ezpublish-migrations-bundle

Enable the DoctrineMigrationsBundle and the KreaitEzPublishMigrationsBundle in AppKernel.php (eZ Platform) or EzPublishKernel.php (eZ Publish 5):, (*5)

public function registerBundles()
{
    $bundles = array(
        //...
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
        new Kreait\EzPublish\MigrationsBundle\KreaitEzPublishMigrationsBundle(),
    );
}

Configuration

You can configure the bundles in your config.yml. The examples below are the default values., (*6)

doctrine_migrations:
    dir_name: "%kernel.root_dir%/DoctrineMigrations"
    namespace: Application\Migrations
    table_name: migration_versions
    name: Application Migrations

ezpublish_migrations:
    # The login name of the user performing the migrations.
    ez_migrations_user: admin

Usage

The usage is identical to Symfony's DoctrineMigrationBundle, with the addition of the following command:, (*7)

# Generate a blank eZ Publish/Platform enabled migration class
$ ezpublish:migrations:generate

You can access the eZ Repository inside a migration with $this->repository., (*8)

See src/Resources/doc/examples eZ Publish related example migrations., (*9)

Helper methods

Changing the current migration user during a migration

You can change the current eZ Publish user inside a migration by issuing the following command:, (*10)

// All subsequent calls will be made as the user with the given name
$this->changeMigrationUser('another_username');

and restore the default Migration user by using:, (*11)

// Restores the current user to the configured migrations user.
$this->restoreDefaultMigrationUser();

Quickly create simple content

$this->createContent($parentLocationId, $contentTypeIdentifier, $languageCode, array $fields);

see Create new content example, (*12)

Known issues

When you create a migration using only eZ Publish's API methods, no SQL statements are executed in terms of the DoctrineMigrationsBundle. This results in the following message:, (*13)

Migration was executed but did not result in any SQL statements., (*14)

Alternatives

The Versions

26/04 2016

dev-feature/helpers

dev-feature/helpers https://github.com/kreait/ezpublish-migrations-bundle

Migrations for eZ Publish/eZ Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

migrations ezpublish ezplatform

05/04 2016
27/01 2016

3.0.1

3.0.1.0 https://github.com/kreait/ezpublish-migrations-bundle

Migrations for eZ Publish/eZ Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

migrations ezpublish ezplatform

13/12 2015

3.0

3.0.0.0 https://github.com/kreait/ezpublish-migrations-bundle

Migrations for eZ Publish/eZ Platform

  Sources   Download

MIT

The Requires

 

The Development Requires

migrations ezpublish ezplatform