if ($direction == 'UP' && $version > $schema_version->version && $version <= $INTEND_VERSION) { // require_once($file); $migration = new $classname(); $migration->up(); $schema_version->version = $version; $schema_version->update(); print_migration_status($direction, $classname, $version); } if ($direction == 'DOWN' && $version <= $schema_version->version && $version > $INTEND_VERSION) { // require_once($file); $migration = new $classname(); $migration->down(); if ($i == count($files) - 1) { $down_version = 0; } else { $matches = Migration::parse_migration_filename($files[$i + 1]); if (!empty($matches)) { $down_version = $matches[1]; } } $schema_version->version = $down_version; $schema_version->update(); print_migration_status($direction, $classname, $down_version); } } } // close db connection $db->close(); // cache refresh require_once dirname(__FILE__) . '/refresh.php'; // remove all clearly