Skip to content

Commit

Permalink
feat: add wp_version flag to override WordPress verion
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhtungdu committed Jan 22, 2021
1 parent bc22331 commit 40d7c1d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/classes/Command/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ protected function configure() {
$this->addOption( 'db_name', null, InputOption::VALUE_REQUIRED, 'Database name.' );
$this->addOption( 'db_user', null, InputOption::VALUE_REQUIRED, 'Database user.' );
$this->addOption( 'db_password', null, InputOption::VALUE_REQUIRED, 'Database password.' );

$this->addOption( 'wp_version', null, InputOption::VALUE_OPTIONAL, 'Override the WordPress version.' );
}

/**
Expand Down Expand Up @@ -149,6 +151,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
'repository' => $repository->getName(),
'contains_db' => $include_db,
'contains_files' => $include_files,
'wp_version' => $input->getOption( 'wp_version' ),
],
$output,
$input->getOption( 'verbose' )
Expand Down
3 changes: 3 additions & 0 deletions src/classes/Command/Push.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ protected function configure() {
$this->addOption( 'db_password', null, InputOption::VALUE_REQUIRED, 'Database password.' );
$this->addOption( 'exclude', false, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Exclude a file or directory from the snapshot.' );
$this->addOption( 'exclude_uploads', false, InputOption::VALUE_NONE, 'Exclude uploads from pushed snapshot.' );

$this->addOption( 'wp_version', null, InputOption::VALUE_OPTIONAL, 'Override the WordPress version.' );
}
/**
* Executes the command
Expand Down Expand Up @@ -175,6 +177,7 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
'repository' => $repository->getName(),
'contains_db' => $include_db,
'contains_files' => $include_files,
'wp_version' => $input->getOption( 'wp_version' ),
], $output, $verbose
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/classes/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ public static function create( $args ) {
);

$meta['wp_version'] = ( ! empty( $wp_version ) ) ? $wp_version : '';
if ( ! empty( $args['wp_version'] ) ) {
$meta['wp_version'] = $args['wp_version'];
}

$author_info = RepositoryManager::instance()->getAuthorInfo();
$author = [];
Expand Down

0 comments on commit 40d7c1d

Please sign in to comment.