public static function synchronizeMigrations(CommandEvent $event)
    {
        $packages = $event->getComposer()->getRepositoryManager()
              ->getLocalRepository()->getPackages();
        $installer = $event->getComposer()->getInstallationManager();
        $appMigrationDir = self::getDestinationDir($event->getComposer());
        $io = $event->getIO();
        
        $areFileMigrated = array();
        
        //migrate for root package
        $areFileMigrated[] = self::handlePackage('.', 
              $event->getComposer()->getPackage(),
              $io, 
              $appMigrationDir);
        
        foreach($packages as $package) {
           $areFileMigrated[] = self::handlePackage($installer->getInstallPath($package),
                 $package,
                 $io, 
                 $appMigrationDir);
        }
        
        if (in_array(true, $areFileMigrated)) {
            $io->write("<warning>Some migration files have been imported. "
                  . "You should run `php app/console doctrine:migrations:status` and/or "
                  . "`php app/console doctrine:migrations:migrate` to apply them to your DB.");
        }
    }
public static function synchronizeMigrations(CommandEvent $event)
    {
        $packages = $event->getComposer()->getRepositoryManager()
              ->getLocalRepository()->getPackages();
        $installer = $event->getComposer()->getInstallationManager();
        $appMigrationDir = self::getDestinationDir($event->getComposer());
        $io = $event->getIO();
        
        $areFileMigrated = array();
        
        //migrate for root package
        $areFileMigrated[] = self::handlePackage('.', 
              $event->getComposer()->getPackage(),
              $io, 
              $appMigrationDir);
        
        foreach($packages as $package) {
           $areFileMigrated[] = self::handlePackage($installer->getInstallPath($package),
                 $package,
                 $io, 
                 $appMigrationDir);
        }
        
        if (in_array(true, $areFileMigrated)) {
            $io->write("<warning>Some migration files have been imported. "
                  . "You should run `php app/console doctrine:migrations:status` and/or "
                  . "`php app/console doctrine:migrations:migrate` to apply them to your DB.");
        }
    }
public static function synchronizeMigrations ( CommandEvent $ event ) { $ packages = $ event -> getComposer ( ) -> getRepositoryManager ( ) -> getLocalRepository ( ) -> getPackages ( ) ; $ installer = $ event -> getComposer ( ) -> getInstallationManager ( ) ; $ appMigrationDir = self :: getDestinationDir ( $ event -> getComposer ( ) ) ; $ io = $ event -> getIO ( ) ; $ areFileMigrated = array ( ) ; //migrate for root package $ areFileMigrated [ ] = self :: handlePackage ( '.' , $ event -> getComposer ( ) -> getPackage ( ) , $ io , $ appMigrationDir ) ; foreach ( $ packages as $ package ) { $ areFileMigrated [ ] = self :: handlePackage ( $ installer -> getInstallPath ( $ package ) , $ package , $ io , $ appMigrationDir ) ; } if ( in_array ( true , $ areFileMigrated ) ) { $ io -> write ( "<warning>Some migration files have been imported. " . "You should run `php app/console doctrine:migrations:status` and/or " . "`php app/console doctrine:migrations:migrate` to apply them to your DB." ) ; } }
synchronize migrations files from the installed or updated bundle
to the root bundle

The destination migration dir may be configured in root package with
`app-migrations-dir` key. Default to `app/DoctrineMigrations`

The migrations files are searched in __bundle_path__/Resources/migrations
OR in the path defined by the 'migration-source' directory in the extra
package information defined in package's composer.json file.

If the file is already present AND equal the script ask user for a confirmation
to copy them.


@param CommandEvent $event
@throws \RuntimeException
synchronize migrations files from the installed or updated bundle to the root bundle