Skip to content

Latest commit

 

History

39 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Composer .lock Parser

OOP reader of composer.lock file

Introduction

Parse composer.lock file and return full information about installed packages in OOP style.

Requirements

Features / Goals

  • Create Composer Entity with full general information from composer.lock [DONE]
  • Create Package Entity with full information about packges [DONE]

Installation

Main Setup

"require": {
    "t4web/composer-lock-parser": "1.1.*"
}

Usage

Creating ComposerInfo object and getting all of the packages

$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock');
// default all packages
$packages = $composerInfo->getPackages();
// or explicitly get all packages
$packages = $composerInfo->getPackages($composerInfo::ALL);

echo $packages[0]->getName();
echo $packages[0]->getVersion();
echo $packages[0]->getNamespace();

Getting just production packages.

$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock');
$packages = $composerInfo->getPackages($composerInfo::PRODUCTION);

Getting just development packages.

$composerInfo = new \ComposerLockParser\ComposerInfo('/path/to/composer.lock');
$packages = $composerInfo->getPackages($composerInfo::DEVELOPMENT);

Testing

Tests runs with Codeception

$ codeception run

About

OOP reader of composer.lock file

Resources

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages