Skip to content

Utility for using Composer from PHP scripts

License

Notifications You must be signed in to change notification settings

redhataccess/composer-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CONTENTS OF THIS FILE

  • Introduction
  • Requirements
  • Installation
  • Configuration
  • Usage
    • Example

INTRODUCTION

The Composer API package provides utilities for using Composer from PHP scripts.

Total Downloads Monthly Downloads License

REQUIREMENTS

This package has no requirements outside of Composer.

INSTALLATION

CONFIGURATION

The package has no configurable settings. Installing or uninstalling it should have no side effects.

USAGE

Initialization:

$composer = Composer::getInstance('path/to/root/composer.json', 'path/to/root');

Returns Composer\Composer object:

$composer::getComposer();

Returns array with PackageInterface objects (array with all installed packages, without bower, npm, etc from fxp/composer-asset-plugin):

$composer::getLocalPackages();

Find package by full name and version:

$composer::findPackage($name, $version);

Find package by string:

$composer::searchPackage($query);

Update package by name or all packages with console options:

$composer::updatePackage($name, $options);
$composer::updateAllPackages($options);

Delete package by name or all packages with console options:

$composer::deletePackage($name, $options);
$composer::deleteAllPackages($options);

Run any composer commands:

$composer::runCommand($command, $options);

Example

You can see the work of the component on the example of yii2 module - bookin/yii2-composer-gui

About

Utility for using Composer from PHP scripts

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%