Download the PHP package net-tools/composer-interface without Composer

On this page you can find all versions of the php package net-tools/composer-interface. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-interface

net-tools/composer-interface

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

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 ?

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 :

Property Description
composer_phpbin Path to your PHP binary ; for example : /usr/local/php7.0/bin/php
composer_home Path 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 :

For example, to do the initial setup of Composer :

And then to require a package :

Composer commands have been separated in 3 groups :

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 :

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

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.


All versions of composer-interface with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package net-tools/composer-interface contains the following files

Loading the files please wait ....