2017 © Pedro Peláez
 

library composer-wrapper

image

shadiakiki1986/composer-wrapper

  • Wednesday, January 4, 2017
  • by shadiakiki1986
  • Repository
  • 2 Watchers
  • 4 Stars
  • 203 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

composer-wrapper Build Status

Use composer as a library in your php project, (*1)

This is different than [eviweb/composer-wrapper](composer require eviweb/composer-wrappe://github.com/eviweb/composer-wrapper), (*2)

I should probably choose a different name, but I'm too lazy now, (*3)

Answers SO Run composer with a PHP script in browser, (*4)

Installation

composer require shadiakiki1986/composer-wrapper, (*5)

Usage

Example 1

Get the output of composer show --direct as an array in php:, (*6)

require_once 'vendor/autoload.php';

$cw = new \shadiakiki1986\ComposerWrapper();
$packages = $cw->showDirect();

This will give an associative array with package names as keys and versions as values, e.g. ['composer/composer'=>'1.3.0.0'], (*7)

Example 2

As above, but with specifying a different project composer.json:, (*8)

require_once 'vendor/autoload.php';

// note that the below createComposer function supports passing in a ''localConfig'' parameter, as well as ''cwd'' parameter
// Check https://github.com/composer/composer/blob/master/src/Composer/Factory.php#L263
$io = new \Composer\IO\NullIO();
$factory = new \Composer\Factory();
$composer = $factory->createComposer($io,'/path/to/another/composer.json');

$cw = new \shadiakiki1986\ComposerWrapper($composer);
$packages = $cw->showDirect();

The Versions

04/01 2017

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

04/01 2017

0.0.3

0.0.3.0

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

04/01 2017

0.0.2

0.0.2.0

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki

04/01 2017

0.0.1

0.0.1.0

  Sources   Download

The Requires

 

The Development Requires

by Shadi Akiki