Skip to content

phpcr/phpcr-migrations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPCR Migrations

Migrations library for PHPCR based heavily on Doctrine migrations.

Usage

$storage = new VersionStorage($phpcrSession);
$finder = new VersionFinder(array('/path/to/migrations'));

$versions = $finder->getVersionCollection();
$migrator = new Migrator($session, $versionCollection, $storage);

$to = '201504241744';
$migrator->migrate($to);

Versions

Version classes contain up and down methods. The class is quite simple:

<?php

class Version201504241200 implements VersionInterface
{
    public function up(SessionInterface $session)
    {
        $session->doSomething();
    }

    public function down(SessionInterface $session)
    {
        $session->undoSomething();
    }
}

They must be named VersionYYYMMDDHHMM. If they are not so named, then they will not be detected.

About

PHPCR Migrations library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6

Languages