Skip to content

Instantly share code, notes, and snippets.

View filda's full-sized avatar
💬
Yes

Filip Šubr filda

💬
Yes
  • Shoptet
  • Praha
  • 00:34 (UTC +02:00)
View GitHub Profile
@filda
filda / parseLock.php
Last active September 21, 2022 06:58
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'];