Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
18673ef
466: update command helper to support multiple package arguments
asgrim Jun 18, 2026
24aec63
466: update PieComposerRequest to have a list of packages
asgrim Jun 18, 2026
5dc5a51
466: extract currentContent to public method for PieJsonEditor
asgrim Jun 18, 2026
0baf9ab
466: update dependency resolution for info/download/build/install to …
asgrim Jun 18, 2026
d7f981f
466: Updated \Php\Pie\ComposerIntegration\ComposerIntegrationHandler:…
asgrim Jun 18, 2026
d1352d6
466: updating feature descriptions to allow download/build/install/un…
asgrim Jun 19, 2026
9d456d6
466: update broken usages of PieComposerRequest->requestedPackage to …
asgrim Jun 22, 2026
289d56a
466: updated uninstall command and composer integration to work with …
asgrim Jun 22, 2026
7cd8327
466: fixing up ShowCommand to use resolved package VO
asgrim Jun 22, 2026
7b3983e
466: requested-package-and-version is an array now
asgrim Jun 22, 2026
cc90df0
466: when installing for a PHP project, invoke pie install <list-of-p…
asgrim Jun 24, 2026
3dfaade
466: Fix system dependency prescan
asgrim Jun 24, 2026
507d632
466: fix usages of PieComposerRequest/Platform repository now needing…
asgrim Jun 24, 2026
f79ba35
466: fix usages of package needing ->piePackage now
asgrim Jun 24, 2026
07adb2a
466: fix usage of PHP project installer now accepting a list of pacakges
asgrim Jun 24, 2026
719238f
466: fix remaining unit test issues
asgrim Jun 24, 2026
8648586
466: fixing up integration tests
asgrim Jun 24, 2026
04d2dcf
466: handle configure flags properly for multiple packages
asgrim Jun 24, 2026
1429c65
466: prevent test from outputting using NullOutput
asgrim Jun 24, 2026
38a4eeb
466: handle edge case of collisions of configure options
asgrim Jun 24, 2026
868e4d1
466: only support a single ext for pie info
asgrim Jun 24, 2026
dddf53f
466: extract array_maps to reduce repetition
asgrim Jun 24, 2026
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 features/build-extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ Feature: Extensions can be built with PIE
Example: An extension can be built with configure options
When I run a command to build an extension with configure options
Then the extension should have been built with options

# pie build <ext1> <ext2>
Example: Multiple extensions can be built at once
When I run a command to build multiple extensions
Then the extensions should have been built
1 change: 1 addition & 0 deletions features/bundled-php-extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Feature: Bundled PHP extensions can be installed
When I install the sodium extension with PIE
Then the extension should have been installed and enabled

# pie uninstall php/sodium
Example: A bundled extension installed with PIE can be uninstalled
Given I have the sodium extension installed with PIE
When I run a command to uninstall an extension
Expand Down
5 changes: 5 additions & 0 deletions features/download-extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ Feature: Extensions can be downloaded with PIE
Example: An in-development version can be downloaded on non-Windows systems
When I run a command to download version "dev-main" of an extension
Then version "dev-main" should have been downloaded

# pie download <ext1> <ext2>
Example: Multiple extensions can be downloaded at once
When I run a command to download multiple extensions
Then the extensions should have been downloaded
5 changes: 5 additions & 0 deletions features/install-extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ Feature: Extensions can be installed with PIE
Example: An extension can be installed and enabled
When I run a command to install an extension
Then the extension should have been installed and enabled

# pie install <ext1> <ext2>
Example: Multiple extensions can be installed at once
When I run a command to install multiple extensions
Then the extensions should have been installed and enabled
6 changes: 6 additions & 0 deletions features/uninstall-extensions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Feature: Extensions can be uninstalled with PIE
Given an extension was previously installed and enabled
When I run a command to uninstall an extension
Then the extension should not be installed anymore

# pie uninstall <ext1> <ext2>
Example: Multiple extensions can be uninstalled at once
Given multiple extensions were previously installed and enabled
When I run a command to uninstall multiple extensions
Then the extensions should not be installed anymore
6 changes: 0 additions & 6 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ parameters:
count: 1
path: src/Command/SelfVerifyCommand.php

-
message: '#^Cannot cast mixed to string\.$#'
identifier: cast.string
count: 1
path: src/Command/UninstallCommand.php

-
message: '#^Call to function assert\(\) with true will always evaluate to true\.$#'
identifier: function.alreadyNarrowedType
Expand Down
53 changes: 27 additions & 26 deletions src/Command/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Php\Pie\DependencyResolver\DependencyInstaller\PrescanSystemDependencies;
use Php\Pie\DependencyResolver\DependencyResolver;
use Php\Pie\DependencyResolver\InvalidPackageName;
use Php\Pie\DependencyResolver\ResolvedPackageRequest;
use Php\Pie\DependencyResolver\UnableToResolveRequirement;
use Php\Pie\Installing\InstallForPhpProject\FindMatchingPackages;
use Php\Pie\Platform\PackageManager;
Expand All @@ -25,8 +26,6 @@
use Symfony\Component\Console\Output\OutputInterface;
use Throwable;

use function sprintf;

#[AsCommand(
name: 'build',
description: 'Download and build a PIE-compatible PHP extension, without installing it.',
Expand Down Expand Up @@ -56,7 +55,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
{
$targetPlatform = CommandHelper::determineTargetPlatformFromInputs($input, $this->io);
try {
$requestedNameAndVersion = CommandHelper::requestedNameAndVersionPair($input);
$requestedNamesAndVersions = CommandHelper::requestedNameAndVersionPairs($input);
} catch (InvalidPackageName $invalidPackageName) {
return CommandHelper::handlePackageNotFound(
$invalidPackageName,
Expand Down Expand Up @@ -84,34 +83,38 @@ public function execute(InputInterface $input, OutputInterface $output): int
new PieComposerRequest(
$this->io,
$targetPlatform,
$requestedNameAndVersion,
$requestedNamesAndVersions,
PieOperation::Resolve,
[], // Configure options are not needed for resolve only
false, // setting up INI not needed for build
),
);

if (CommandHelper::shouldCheckSystemDependencies($input)) {
try {
($this->prescanSystemDependencies)(
$composer,
$targetPlatform,
$requestedNameAndVersion,
CommandHelper::autoInstallSystemDependencies($input),
);
} catch (Throwable $anything) {
$this->io->writeError(
'<comment>Skipping system dependency pre-scan due to exception:</comment> ' . $anything->getMessage(),
verbosity: IOInterface::VERBOSE,
);
foreach ($requestedNamesAndVersions as $requestedNameAndVersion) {
try {
($this->prescanSystemDependencies)(
$composer,
$targetPlatform,
$requestedNameAndVersion,
CommandHelper::autoInstallSystemDependencies($input),
);
} catch (Throwable $anything) {
$this->io->writeError(
'<comment>Skipping system dependency pre-scan due to exception:</comment> ' . $anything->getMessage(),
verbosity: IOInterface::VERBOSE,
);
}
}
}

try {
$package = ($this->dependencyResolver)(
$resolvedPackages = CommandHelper::resolveRequestedPackages(
$this->dependencyResolver,
$this->io,
$composer,
$targetPlatform,
$requestedNameAndVersion,
$requestedNamesAndVersions,
$forceInstallPackageVersion,
);
} catch (UnableToResolveRequirement $unableToResolveRequirement) {
Expand All @@ -129,19 +132,18 @@ public function execute(InputInterface $input, OutputInterface $output): int
return self::INVALID;
}

$this->io->write(sprintf('<info>Found package:</info> %s which provides <info>%s</info>', $package->prettyNameAndVersion(), $package->extensionName()->nameWithExtPrefix()));

// Now we know what package we have, we can validate the configure options for the command and re-create the
// Now we know what packages we have, we can validate the configure options for the command and re-create the
// Composer instance with the populated configure options
CommandHelper::bindConfigureOptionsFromPackage($this, $package, $input);
$configureOptionsValues = CommandHelper::processConfigureOptionsFromInput($package, $input);
$resolvedPiePackages = ResolvedPackageRequest::piePackages($resolvedPackages);
CommandHelper::bindConfigureOptionsFromPackage($this, $resolvedPiePackages, $input);
$configureOptionsValues = CommandHelper::processConfigureOptionsFromInput($resolvedPiePackages, $input);

$composer = PieComposerFactory::createPieComposer(
$this->container,
new PieComposerRequest(
$this->io,
$targetPlatform,
$requestedNameAndVersion,
$requestedNamesAndVersions,
PieOperation::Build,
$configureOptionsValues,
false, // setting up INI not needed for build
Expand All @@ -150,10 +152,9 @@ public function execute(InputInterface $input, OutputInterface $output): int

try {
$this->composerIntegrationHandler->runInstall(
$package,
$resolvedPackages,
$composer,
$targetPlatform,
$requestedNameAndVersion,
$forceInstallPackageVersion,
false,
);
Expand Down
Loading
Loading