Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to Phive are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [Unreleased]

### Added
* Added `--trust-gpg-keys` option to the `update` command to silently import GPG keys when required

## [0.16.0] - 2025-04-10

__Please note__: Version 0.16.x requires PHP 8.0 or later.
Expand Down
10 changes: 6 additions & 4 deletions src/commands/help/help.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,15 @@

_-s, --status_ Show the status of all migrations

**update [--prefer-offline] [<alias1> <alias2> ...]**
**update [--prefer-offline] [--trust-gpg-keys] [<alias1> <alias2> ...]**
Update PHARs configured in the project's phive.xml to the newest applicable version.

_--prefer-offline_ Try to use local PHARs first, only connect to remote repositories
if no local PHAR satisfies the given version constraint.
_--prefer-offline_ Try to use local PHARs first, only connect to remote repositories
if no local PHAR satisfies the given version constraint.
_--trust-gpg-keys_ Silently import these keys when required (40-digit fingerprint
or 16-digit long key ID, optionally with the `0x` prefix, separated by comma)

_alias_ If one or more aliases are provided, only those will be updated
_alias_ If one or more aliases are provided, only those will be updated

**update-repository-list**
Update the alias list of known PHAR distributed applications and libraries
Expand Down
6 changes: 6 additions & 0 deletions src/commands/update/UpdateContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
*/
namespace PharIo\Phive;

use function in_array;
use PharIo\Phive\Cli\GeneralContext;

class UpdateContext extends GeneralContext {
public function requiresValue(string $option): bool {
return in_array($option, ['trust-gpg-keys'], true);
}

protected function getKnownOptions(): array {
return [
'force-accept-unsigned' => false,
'prefer-offline' => false,
'trust-gpg-keys' => false,
'global' => 'g'
];
}
Expand Down