Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial implementation of bin/pie download #11

Merged
merged 43 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
86192a4
Added happy and sad tests for resolving a requested package and version
asgrim Feb 29, 2024
93071b8
Added a basic VO to be expanded upon to represent an installable package
asgrim Feb 29, 2024
3c771d1
Added DependencyResolver interface to be used by DownloadCommand
asgrim Feb 29, 2024
723fe5b
Use Composer to resolve dependencies
asgrim Mar 1, 2024
a5e7c5c
Updated DownloadCommand to be an integration test
asgrim Mar 1, 2024
18f6778
Enable Psalm testing on test suite too
asgrim Mar 1, 2024
2c35b2c
Basic implementation of downloading and extracting the source archive…
asgrim Mar 8, 2024
33d65d4
Introduce Illuminate Container for service location
asgrim Mar 8, 2024
3323693
Rewire some Composer dependencies and console IO
asgrim Mar 8, 2024
52d6b65
Added helper to find the PHP binary
asgrim Apr 1, 2024
892c536
Ensure target PHP platform is used to resolve package version
asgrim Apr 1, 2024
2b90095
Ensure package resolved is a php-ext or php-ext-zend
asgrim Apr 1, 2024
f757ee9
When fetching PHP version, do not include the 'extra' information in …
asgrim Apr 1, 2024
c7fb06c
Added Windows downloading support
asgrim Apr 12, 2024
d7b2985
Adjusted annotations for immutable/internal
asgrim Apr 15, 2024
f3bbf03
Use DIRECTORY_SEPARATOR constant instead of literal forward-slash
asgrim Apr 24, 2024
c60458f
Added a bunch of unit tests for existing code
asgrim Apr 24, 2024
32cc5b6
Split out some components and add test coverage
asgrim Apr 24, 2024
a8eae46
Added Windows test execution
asgrim Apr 24, 2024
b9bc676
Display skipped test details for CI pipelines
asgrim Apr 24, 2024
1b41939
Added assertions on response status code
asgrim Apr 24, 2024
b580dbe
Handle specifically the release for a tag being missing in GH
asgrim Apr 24, 2024
6891cc8
Ensure DownloadCommandTest can download any compatible version of exa…
asgrim Apr 24, 2024
778d231
Extracted temp path creation to static helper
asgrim Apr 24, 2024
dc1e64d
Introduce ExtensionName value object with normalisation
asgrim Apr 24, 2024
0333630
Determine extension name for a Package
asgrim Apr 29, 2024
4debebb
Parameterise the GH URL from container
asgrim Apr 29, 2024
0ba54f7
Move TargetPhp namespace into new Platform namespace
asgrim Apr 29, 2024
122327e
Added TargetPlatform value object
asgrim Apr 30, 2024
259e121
Determine 32-bit/64-bit Intel architecture better
asgrim May 16, 2024
2df72b3
Use TargetPlatform to determine the correct Windows asset to download
asgrim May 16, 2024
812a814
Support both compiler-ts and ts-compiler naming
asgrim May 16, 2024
9629815
Test coverage improvement
asgrim May 16, 2024
9be752b
Do not use phpBinaryPath from current process where a fixed name is n…
asgrim May 16, 2024
d6dd3ba
Added more test cases for various version constraints to download com…
asgrim May 16, 2024
d8b0313
Added basic docs for download command
asgrim May 16, 2024
d8d93a2
Include extensions in the platform list based on the given PhpBinaryPath
asgrim May 27, 2024
e4261c3
Added --with-php-path option to bin/pie download
asgrim May 27, 2024
aaa26e7
Add link to GH issue for todo comment
asgrim May 27, 2024
0ab0ada
Added README notes for --with-php-path and examples for Win/nonWin
asgrim May 27, 2024
1188579
Improve help text for requested package and version option
asgrim Jun 3, 2024
2298ae7
Adjust output of target PHP install information to simplify
asgrim Jun 3, 2024
ff55375
Improve wording for php-config and php-path help options
asgrim Jun 3, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
/psalm.xml
/.phpunit.cache/
/.phpunit.result.cache
/.phpcs-cache
9 changes: 9 additions & 0 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace PHPSTORM_META {
override(\Psr\Container\ContainerInterface::get(0),
map([
'' => '@',
])
);
}
20 changes: 15 additions & 5 deletions bin/pie
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@

declare(strict_types=1);

use Php\Pie\Command;
namespace Php\Pie;

use Php\Pie\Command\DownloadCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/** @psalm-suppress UnresolvableInclude */
include $_composer_autoload_path ?? __DIR__ . '/../vendor/autoload.php';

$container = Container::factory();

$application = new Application('pie', 'dev-main');
$application->addCommands([
new Command\DownloadCommand(),
]);
$application->run();
$application->setCommandLoader(new ContainerCommandLoader(
$container,
[
'download' => DownloadCommand::class,
]
));
$application->run($container->get(InputInterface::class), $container->get(OutputInterface::class));
14 changes: 13 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
},
"autoload-dev": {
"psr-4": {
"Php\\PieIntegrationTest\\": "test/integration/",
"Php\\PieUnitTest\\": "test/unit/"
}
},
Expand All @@ -26,11 +27,22 @@
],
"require": {
"php": "8.1.*||8.2.*||8.3.*",
"symfony/console": "^6.4"
"ext-zip": "*",
"azjezz/psl": "^2.9",
"composer/composer": "dev-main@dev",
"guzzlehttp/guzzle": "^7.8",
"guzzlehttp/psr7": "^2.6",
"illuminate/container": "^10.47",
"psr/http-message": "^2.0",
"symfony/console": "^6.4",
"symfony/process": "^6.4",
"webmozart/assert": "^1.11"
},
"require-dev": {
"doctrine/coding-standard": "^12.0",
"php-standard-library/psalm-plugin": "^2.3",
"phpunit/phpunit": "^10.5",
"psalm/plugin-phpunit": "^0.18.4",
"vimeo/psalm": "^5.22"
},
"config": {
Expand Down
Loading