PHP code example of violinist-dev / composer-lock-data

1. Go to this page and download the library: Download violinist-dev/composer-lock-data library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

violinist-dev / composer-lock-data example snippets


// Read our own lock file. This is taken from the tests in this very project.
$data = ComposerLockData::createFromFile(__DIR__ . '/../../composer.lock');
$package_data = $data->getPackageData('phpunit/phpunit');
// Package data will now be something like this (example with json print):
print json_encode($package_data, JSON_PRETTY_PRINT);