src/Phinx/Migration/Manager.php
public function executeMigration($name, MigrationInterface $migration, $direction = MigrationInterface::UP, $fake = false)
    {
        $this->getOutput()->writeln('');
        $this->getOutput()->writeln(
            ' ==' .
            ' <info>' . $migration->getVersion() . ' ' . $migration->getName() . ':</info>' .
            ' <comment>' . ($direction === MigrationInterface::UP ? 'migrating' : 'reverting') . '</comment>'
        );
        $migration->preFlightCheck($direction);

        // Execute the migration and log the time elapsed.
        $start = microtime(true);
        $this->getEnvironment($name)->executeMigration($migration, $direction, $fake);
        $end = microtime(true);

        $migration->postFlightCheck($direction);
        $this->getOutput()->writeln(
            ' ==' .
            ' <info>' . $migration->getVersion() . ' ' . $migration->getName() . ':</info>' .
            ' <comment>' . ($direction === MigrationInterface::UP ? 'migrated' : 'reverted') .
            ' ' . sprintf('%.4fs', $end - $start) . '</comment>'
        );
    }
public function executeMigration($name, MigrationInterface $migration, $direction = MigrationInterface::UP, $fake = false)
    {
        $this->getOutput()->writeln('');
        $this->getOutput()->writeln(
            ' ==' .
            ' <info>' . $migration->getVersion() . ' ' . $migration->getName() . ':</info>' .
            ' <comment>' . ($direction === MigrationInterface::UP ? 'migrating' : 'reverting') . '</comment>'
        );
        $migration->preFlightCheck($direction);

        // Execute the migration and log the time elapsed.
        $start = microtime(true);
        $this->getEnvironment($name)->executeMigration($migration, $direction, $fake);
        $end = microtime(true);

        $migration->postFlightCheck($direction);
        $this->getOutput()->writeln(
            ' ==' .
            ' <info>' . $migration->getVersion() . ' ' . $migration->getName() . ':</info>' .
            ' <comment>' . ($direction === MigrationInterface::UP ? 'migrated' : 'reverted') .
            ' ' . sprintf('%.4fs', $end - $start) . '</comment>'
        );
    }
public function executeMigration ( $ name , MigrationInterface $ migration , $ direction = MigrationInterface :: UP , $ fake = false ) { $ this -> getOutput ( ) -> writeln ( '' ) ; $ this -> getOutput ( ) -> writeln ( ' ==' . ' <info>' . $ migration -> getVersion ( ) . ' ' . $ migration -> getName ( ) . ':</info>' . ' <comment>' . ( $ direction === MigrationInterface :: UP ? 'migrating' : 'reverting' ) . '</comment>' ) ; $ migration -> preFlightCheck ( $ direction ) ; // Execute the migration and log the time elapsed. $ start = microtime ( true ) ; $ this -> getEnvironment ( $ name ) -> executeMigration ( $ migration , $ direction , $ fake ) ; $ end = microtime ( true ) ; $ migration -> postFlightCheck ( $ direction ) ; $ this -> getOutput ( ) -> writeln ( ' ==' . ' <info>' . $ migration -> getVersion ( ) . ' ' . $ migration -> getName ( ) . ':</info>' . ' <comment>' . ( $ direction === MigrationInterface :: UP ? 'migrated' : 'reverted' ) . ' ' . sprintf ( '%.4fs' , $ end - $ start ) . '</comment>' ) ; }
Execute a migration against the specified environment.

@param string $name Environment Name
@param \Phinx\Migration\MigrationInterface $migration Migration
@param string $direction Direction
@param bool $fake flag that if true, we just record running the migration, but not actually do the migration
@return void
Execute a migration against the specified environment .