当前位置: 首页>>代码示例>>PHP>>正文


PHP Migration::pushTime方法代码示例

本文整理汇总了PHP中Migration::pushTime方法的典型用法代码示例。如果您正苦于以下问题:PHP Migration::pushTime方法的具体用法?PHP Migration::pushTime怎么用?PHP Migration::pushTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Migration的用法示例。


在下文中一共展示了Migration::pushTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: krsort

} else {
    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
开发者ID:humansky,项目名称:qframe,代码行数:31,代码来源:migrate.php


注:本文中的Migration::pushTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。