Up! A Composer library for self-updating projects
OTHER License
Up! is a simple library for running Composer commands from within your application.
Up! works by extending Composer's internal library and adding some simple methods which handle most of the configuration and setup for you.
Up! currently supports three key Composer features:
composer.json
file.composer.lock
file, unless no file is present then use the composer.json
fileUp! will assume that the relevant Composer configuration files are in the current working directory, unless specified via the setBaseDir()
method
<?php
use Mothership\Up\Up;
$up = new Up;
// Update your project from the current working directory
$up->update();
// Update your project from a different directory
$up->setBaseDir('/path/to/project')->update();
// Synchronise your project with the `composer.lock` file
$up->install();
// Synchronise your project from a `composer.lock` file in a different directory
$up->setBaseDir('/path/to/project')->install();
// Create a new project from a Composer package
$up->createProject('mothership-ec/mothership');
// Create a new project from a Composer package in a different directory
$up->setBaseDir('/path/to/project')->createProject('mothership-ec/mothership');
Up! must be installed using Composer by adding mothership-ec/up
to your composer.json
file. See the Composer documentation for more information.