本文整理汇总了PHP中Migration::popTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Migration::popTime方法的具体用法?PHP Migration::popTime怎么用?PHP Migration::popTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Migration
的用法示例。
在下文中一共展示了Migration::popTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: krsort
krsort($migrations);
}
// Sort migrations that need to run and run 'em
foreach ($migrations as $version => $migration) {
// continue to the next iteration if we are already past this version
$current = Migration_Adapter::getAdapter()->getSchemaVersion();
if ($migrateUp && $version <= $current || !$migrateUp && $version > $current) {
continue;
}
// break from the loop if we have reached the desired version
if ($migrateUp && $version > $target || !$migrateUp && $version <= $target) {
break;
}
// print a message indicating that we are starting a migration
Migration::pushTime("== {$version} {$migration}: migrat", 'ing ', 'ed ', true, '=', 80);
// create an instance of the migration class and call it's up (or down) method
$class = new ReflectionClass($migration);
$instance = $class->newInstance();
if ($migrateUp) {
Migration_Adapter::getAdapter()->up($instance, $version);
} else {
Migration_Adapter::getAdapter()->down($instance, $version);
}
// print a message indicating that we are down with this migration
Migration::popTime();
}
// If we have gotten to this point make sure the schema version is set to the target (especially
// important for migrating down since we never actually run the target migration)
Migration_Adapter::getAdapter()->setSchemaVersion($target);
// Print a final newline
echo "\n";