2017 © Pedro Peláez
 

library composer-wrapper

Composer Wrapper for PHP 5.3

image

eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  • Friday, April 10, 2015
  • by eviweb
  • Repository
  • 2 Watchers
  • 6 Stars
  • 8,102 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Composer Wrapper

This project aims to provide a way to use composer from within a script, even if it is not installed., (*1)

Build Status, (*2)

How to install :

You can choose between :
1. clone this repo git clone https://github.com/eviweb/composer-wrapper.git
2. use composer by adding "eviweb/composer-wrapper" : "1.*" to the require section of your composer.json
3. directly download the Wrapper.php
4. dynamic install see below, (*3)

How to use :

Include the wrapper

First, you need to include the wrapper into your code, according to the previous installation choice :, (*4)

  1. add require_once 'PATH_TO_COMPOSER_WRAPPER_DIRECTORY/src/evidev/composer/Wrapper.php'; where PATH_TO_COMPOSER_WRAPPER_DIRECTORY is the path to the cloned repository
  2. add require 'vendor/autoload.php'; please refer to the Composer Documentation
  3. add require_once 'PATH_TO_COMPOSER_WRAPPER_FILE'; where PATH_TO_COMPOSER_WRAPPER_FILE is the path to the Wrapper.php file
  4. add
$wrapper_file = sys_get_temp_dir() . '/Wrapper.php';
if (!file_exists($wrapper_file)) {
    file_put_contents(
        $wrapper_file,
        file_get_contents('https://raw.github.com/eviweb/composer-wrapper/master/src/evidev/composer/Wrapper.php')
    );
}
require_once $wrapper_file;    

Use the wrapper

  1. for a command line use, simply add exit(\evidev\composer\Wrapper::create()->run()); to your executable script
  2. if you want to use it in the body of your script, and pass specific arguments to the Wrapper::run() method you need to do as the following :
$wc = \evidev\composer\Wrapper::create();
$exit_code = $wc->run("COMPOSER_OPTION_OR_COMMAND_AS_STRING");
// add more code here for example
exit($exit_code);

where COMPOSER_OPTION_OR_COMMAND_AS_STRING is a composer option or command, (*5)

How it works

The Wrapper downloads the composer.phar file when created.
By default the composer.phar is downloaded in sys_get_temp_dir(), but you can specify a target directory by passing its path as a parameter of Wrapper::create().
If this parameter is an empty string or if the directory does not exist, sys_get_temp_dir() is used as fallback
In case of use of many instances of the Wrapper, created with different directories (which should never happened), the first downloaded composer.phar is used., (*6)

The Versions

10/04 2015

dev-fix-selfupdate-issue-8

dev-fix-selfupdate-issue-8 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

composer wrapper

08/04 2015

dev-master

9999999-dev https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

composer wrapper

08/04 2015

v1.0.5

1.0.5.0 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

composer wrapper

08/04 2015

v1.0.4

1.0.4.0 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

composer wrapper

26/09 2014

v1.0.3

1.0.3.0 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

composer wrapper

17/02 2013

v1.0.1

1.0.1.0 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

composer wrapper

15/02 2013

v1.0

1.0.0.0 https://github.com/eviweb/composer-wrapper

Composer Wrapper for PHP 5.3

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

composer wrapper