承接 foogile/wp-cli-mig 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

foogile/wp-cli-mig

最新稳定版本:v0.0.2

Composer 安装命令:

composer require foogile/wp-cli-mig

包简介

General migration command for WP-CLI

README 文档

README

General migration command for WP-CLI

Example migration

  1. Create migration script

    // filename: migrations/1_FirstMigration.php
    namespace WpCliMigrate;
    
    use Foogile\WpCli\Migrate\MigrationInterface;
    
    class FirstMigration implements MigrationInterface
    {
    
        public function up()
        {
            // Do some work using WordPress API
        }
    
        public function down()
        {
            // Undo some work using WordPress API
        }
    
    }
  2. Move into folder migrations and execute migrations using WP-CLI

        # Migrate to version 1
        wp --require=/path/to/command.php mig to 1
    
        # Migrate to version 2
        wp --require=/path/to/command.php mig to 2
        
        # Revert all migrations
        wp --require=/path/to/command.php mig to 0
    
        # Status
        wp --require=/path/to/command.php mig status

For migrations that should stop execution, throw exceptions from up/down-methods. I.e. a non-reversable migration will typically refuse a down()-operation: throw new \Exception("Cannot rollback migration").

统计信息

  • 总下载量: 13.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 23
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 23
  • Watchers: 3
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: WTFPL
  • 更新时间: 2014-02-17