Skip to content

Instantly share code, notes, and snippets.

View wotaen's full-sized avatar
🐢

Michal Holub wotaen

🐢
View GitHub Profile
@wotaen
wotaen / parseLock.php
Created September 21, 2022 06:52 — forked from filda/parseLock.php
Read composer.lock file and generate useful commands to help install packages in another project
<?php
$cmsJsonFile = file_get_contents('composer.json');
$cmsJsonArray = json_decode($cmsJsonFile, true);
$libsLockFile = file_get_contents('../libraries/composer.lock');
$libsLockArray = json_decode($libsLockFile, true);
$cmsRequires = $cmsJsonArray['require'];
$libsPackages = $libsLockArray['packages'];