Download the PHP package eviweb/composer-wrapper without Composer
On this page you can find all versions of the php package eviweb/composer-wrapper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eviweb/composer-wrapper
More information about eviweb/composer-wrapper
Files in eviweb/composer-wrapper
Package composer-wrapper
Short Description Composer Wrapper for PHP 5.3
License MIT
Homepage https://github.com/eviweb/composer-wrapper
Informations about the package composer-wrapper
Composer Wrapper
This project aims to provide a way to use composer from within a script, even if it is not installed.
How to install :
You can choose between :
- clone this repo
- use composer by adding to the require section of your composer.json
- directly download the Wrapper.php
- dynamic install see below
How to use :
Include the wrapper
First, you need to include the wrapper into your code, according to the previous installation choice :
- add
require_once 'PATH_TO_COMPOSER_WRAPPER_DIRECTORY/src/evidev/composer/Wrapper.php';
where _PATH_TO_COMPOSER_WRAPPERDIRECTORY is the path to the cloned repository - add
require 'vendor/autoload.php';
please refer to the Composer Documentation - add
require_once 'PATH_TO_COMPOSER_WRAPPER_FILE';
where _PATH_TO_COMPOSER_WRAPPERFILE is the path to the Wrapper.php file - add
Use the wrapper
- for a command line use, simply add
exit(\evidev\composer\Wrapper::create()->run());
to your executable script - 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 :
where _COMPOSER_OPTION_OR_COMMAND_ASSTRING is a composer option or command
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.