Skip to content

Instantly share code, notes, and snippets.

@veewee
Last active April 12, 2018 07:08
Show Gist options
  • Save veewee/d2b0e2a1327e41458daf4453f8ae61b1 to your computer and use it in GitHub Desktop.
Save veewee/d2b0e2a1327e41458daf4453f8ae61b1 to your computer and use it in GitHub Desktop.
Composer - grumphp issue tester
[
{
"version": "1.6.3",
"sha256": "52cb7bbbaee720471e3b34c8ae6db53a38f0b759c06078a80080db739e4dcab6"
},
{
"version": "1.6.2",
"sha256": "6ec386528e64186dfe4e3a68a4be57992f931459209fd3d45dde64f5efb25276"
},
{
"version": "1.6.1",
"sha256": "71b6701ab75c93d0986b3e906d9d2586f0ae1b3e611583210a9542021861f581"
},
{
"version": "1.6.0",
"sha256": "45031b4ae95bb6f4bdd33704a1932bfb8b56f5a590ee16b4946f481903c28fd1"
},
{
"version": "1.6.0-RC",
"sha256": "fbbc2a8085331976ff08a7920230a30e38b847b1f3bfbae54e1c0ea6676b2fae"
},
{
"version": "1.5.6",
"sha256": "25e75d72818c4f1d46b3ae47a8deaaf4ef25c87198329d4a6ee53601b00459e5"
},
{
"version": "1.5.5",
"sha256": "8ef8c4fb73c8cc1e950119799aec31e0ae5913dab8dd8f53d9c2e3985ac3ad2b"
},
{
"version": "1.5.4",
"sha256": "b85461bb94c1abf1ccaa6832a7992c08d2d851f844c575626766554bd96de8c3"
},
{
"version": "1.5.3",
"sha256": "f50e3b1d7daa6afc532341e52735db32819310cb2f63cb166f69dc7e074a657e"
},
{
"version": "1.5.2",
"sha256": "c0a5519c768ef854913206d45bd360efc2eb4a3e6eb1e1c7d0a4b5e0d3bbb31f"
},
{
"version": "1.5.1",
"sha256": "2745e7b8cced2e97f84b9e9cb0f9c401702f47cecea5a67f095ac4fa1a44fb80"
},
{
"version": "1.5.0",
"sha256": "8a9f570241f1f858529c13f4d09d38b3379fe1a1d27cb74bc71093f1a8f1b225"
},
{
"version": "1.4.3",
"sha256": "03fc40c59e1e5711d61d6f340e9159ac94701107e0fe05aa795b611d004bdf35"
},
{
"version": "1.4.2",
"sha256": "6b1945c3ee477f12be508a5bb41a5025d57de5510bcf94855ae6a4d59f3d86f4"
},
{
"version": "1.4.1",
"sha256": "abd277cc3453be980bb48cbffe9d1f7422ca1ef4bc0b7d035fda87cea4d55cbc"
},
{
"version": "1.4.0",
"sha256": "2e2d851f9ff3c9b526bfecc2e7f020cc7a74d8f64fbb403061d13f23f091a137"
},
{
"version": "1.3.3",
"sha256": "2a63562e756a27b0f0391461bcf06306b3cfdaef54beec3728dde94e94a99d96"
},
{
"version": "1.3.2",
"sha256": "6a4f761aa34bb69fca86bc411a5e9836ca8246f0fcd29f3804b174fee9fb0569"
}
]
<?php
$versions = json_decode(file_get_contents('composer-versions.json'), true);
foreach ($versions as $info) {
chdir(__DIR__);
mkdir($info['version']);
chdir($info['version']);
echo 'Downlaoding v'.$info['version'] . PHP_EOL;
copy(
'https://getcomposer.org/download/'.$info['version'].'/composer.phar',
$file = 'composer.phar'
);
if (hash_file('sha256', $file) !== $info['sha256']) {
echo 'Skipped ... Invalid hash!';
continue;
}
echo 'Testing installation' . PHP_EOL;
$output = [];
$statusCode = 0;
exec('php composer.phar require --dev phpro/grumphp doctrine/collections:dev-master#25c9b48172190ddd9e6f6b1ce41f6270fe533f5a', $output, $statusCode);
if ($statusCode === 0) {
echo 'Version OK' . PHP_EOL . PHP_EOL;
continue;
}
echo 'Version NOK: code ' . $statusCode . PHP_EOL;
echo PHP_EOL;
}
echo 'DONE!';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment