Skip to content
The PHP instance of Project-Level Composer.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
System
Composer.php
LICENSE
README.md
functions.php

README.md

Composer

The PHP instance of Project-Level Composer.

This library allows you to install composer on your project making it possible for you to use composer even when it is not installed in the system. Moreover, You can consume the power of composer and its commands outside of the terminal as you normally do use any other PHP class.

Read Blog Post.

Examples

require_once 'Path\To\Composer.php';

// $composer = new \abhishek6262\Composer\Composer('pathToProjectRoot', 'pathToBinDirectory');
$composer = new \abhishek6262\Composer\Composer(__DIR__);

if (! $composer->exists()) {
    $composer->install();
}

if ($composer->packagesExists() && ! $composer->packagesInstalled()) {
    $response = $composer->installPackages();

    if ($response->statusCode() == '0') {
        echo "Packages successfully installed.";
    } else {
        echo "Packages failed to install.";
    }

    print_r($response->output());
}

Credits

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities. I will appreciate that a lot. Also please add your name to the credits.

Kindly follow me on twitter!

Support

Moreover, To keep this and my other open source projects ongoing You can also support me on Patreon by clicking on the button below.

License

The MIT License (MIT). Please see License File for more information.

You can’t perform that action at this time.