PHPackages                             net-tools/composer-interface - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. net-tools/composer-interface

ActiveLibrary

net-tools/composer-interface
============================

PHP shell interface to Composer when SSH is not available on your host

1.0.16(2y ago)21.1k↓100%1MITPHPPHP &gt;= 5.4.0

Since Dec 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/net-tools/composer-interface)[ Packagist](https://packagist.org/packages/net-tools/composer-interface)[ RSS](/packages/net-tools-composer-interface/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (13)Used By (1)

net-tools/composer-interface
============================

[](#net-toolscomposer-interface)

PHP interface to Composer when SSH is not available on your host
----------------------------------------------------------------

[](#php-interface-to-composer-when-ssh-is-not-available-on-your-host)

The package contains an helper class to interface with Composer when your host (or hosting plan) does not support SSH (direct access).

With this simple PHP class, you can execute composer command through shell calls and get the output of the command in a string. A simple GUI is also provided in the demo/ folder.

### Setup instructions

[](#setup-instructions)

Download the ZIP release and upload it's content to your host.

Since you are looking for a Composer interface, we assume that you can't run Composer at the moment (no SSH access), that's why you have to manually download the library and upload it on your website.

### How to use ?

[](#how-to-use-)

In order to use the PHP interface to Composer, *and after having uploaded the ZIP release to your host*, you must :

1. create a client config file in JSON format (or define a PHP associative array) ; see below for required parameters,
2. include the `src/autoload.php` file (this is a custom autoload file, since Composer is not installed yet, you don't have its autoload mechanism available),
3. in a PHP script, create a `ComposerInterface` object with a config object and the path of your Composer project,
4. call one of the supported Composer command as methods of the `ComposerInterface` object.

The JSON client config file or the associative config array **MUST** define the following values :

PropertyDescriptioncomposer\_phpbinPath to your PHP binary ; for example : `/usr/local/php7.0/bin/php`composer\_homePath to the Composer home folder ; usually, this is the root of your host account (web root), or one level above.Then create a config instance and pass it to the `ComposerInterface` constructor :

```
// include script (you may point the inclusion to the right path to src/autoload.php)
include_once "autoload.php";

// create config object
$config = \Nettools\ComposerInterface\Config::fromJSON(__DIR__ . '/composer.config.json');
// OR
// $config = \Nettools\ComposerInterface\Config::fromArray(array('composer_phpbin'=>'usr/local/php7.0/bin/php', 'composer_home'=>$_SERVER['DOCUMENT_ROOT']));

// create interface and set the composer project to be in folder LIBCOMPOSER, directly placed under the web root folder
$composer = new ComposerInterface($config, rtrim($_SERVER['DOCUMENT_ROOT'], '/') . '/libcomposer');
```

For example, to do the initial setup of Composer :

```
$output = $composer->setup();
echo "$output";
```

And then to require a package :

```
$output = $composer->package_require('net-tools/core');
echo "$output";
```

Composer commands have been separated in 3 groups :

- global commands
- commands applied to packages
- commands applied to repositories

Global commands are called with the corresponding method name (eg `$composer->diagnose()`). Package commands are called with the *package\_* prefix (eg `$composer->package_update('vendor/name')`). Repositories commands are more specific :

- to add a repository : `$composer->repository_add('path', 'http://url')`
- to remove a repository : `$composer->repository_remove('http://url')`

If you want to send a command not supported by `ComposerInterface`, you may use the `Command` method : `$composer->command('unsupportedcommand vendor/name arguments')`.

### Demo

[](#demo)

A simple GUI interface is provided in the demo/ subfolder.

To run the demo, just modify the provided client config file `composer.config.json` (in the demo folder) to point to the PHP binary on your host, and open your browser to the `gui_demo.php` file of the demo folder. If you don't know the path for the PHP binary, you'd better refer to your host support team.

The demo will create a `libc-composerinterface` folder on your web root. If you want another name or path, modify the `PROJECT` constant on the top lines of the demo file.

**Please note that the demo comes with an empty composer project and no Composer package**. The Composer software **MUST** be installed. To do so, you have to hit the SETUP button on the GUI (or call the `setup` method of `ComposerInterface` in a script of your own). This will download Composer and run the install script. A default composer.json will be created. THEN you can play around with require, update, etc.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~223 days

Recently: every ~139 days

Total

12

Last Release

978d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cb0c1d404c8ae72b0a731246130079c2f440d6ea079815ca8c153aa361b1f28?d=identicon)[nettools.ovh](/maintainers/nettools.ovh)

---

Top Contributors

[![net-tools](https://avatars.githubusercontent.com/u/6818724?v=4)](https://github.com/net-tools "net-tools (9 commits)")

---

Tags

composerphp

### Embed Badge

![Health badge](/badges/net-tools-composer-interface/health.svg)

```
[![Health](https://phpackages.com/badges/net-tools-composer-interface/health.svg)](https://phpackages.com/packages/net-tools-composer-interface)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
