Skip to content

Instantly share code, notes, and snippets.

View shiftenterdev's full-sized avatar
👨‍💻
Working from home

Iftakharul Alam shiftenterdev

👨‍💻
Working from home
View GitHub Profile

Add composer v2 support to older Magento2 versions

Magento 2.4.2 ships with composer v2 support out of the box but as far as I can see the only thing that needs to happen is to use some more modern versions of certain composer plugins which are used by certain dependencies of Magento.

This means we should be able to add composer v2 support to older Magento2 versions as well if we get a bit creative.

See below for diffs of the composer.json files you can apply to your projects, be sure to keep a mental note of these things, they will need to maintained by yourself in case newer versions of these modules are released. And if one day you update to Magento 2.4.2 or higher, you can remove these changes again.

⚠️ Disclaimer: use these tricks at your own risk!

@shiftenterdev
shiftenterdev / example.php
Created February 20, 2020 05:01 — forked from dunglas/example.php
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}