Php - Composer

> Procedural Languages > Php

1 - About

package manager for php.

It manages package

  • on a per-project basis,
  • installing them in a directory (e.g. vendor) inside your project. By default it does not install anything globally. It does however support a “global” project for convenience via the global command.

Composer is strongly inspired by node's npm and ruby's bundler.

2 - composer.json

3 - Management

3.1 - Get

cd /myProjectRoot
composer require namespace/module

3.2 - Basic php file

require_once './vendor/autoload.php';
 
use Module\Class\Path\Hello
echo Hello.get();

4 - Documentation / Reference

Advertising