Php - Composer

Card Puncher Data Processing

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.

composer.json

https://getcomposer.org/doc/04-schema.md

Management

Run

composer xxx

# or

php composer.phar xxx

Get / Require a package

cd /myProjectRoot
composer require namespace/module

Basic php file

require_once './vendor/autoload.php';

use Module\Class\Path\Hello
echo Hello.get();

where composer autoload uses the autoload feature.

Documentation / Reference





Discover More
Phpinfo Mbstring Enabled
Dokuwiki - Dev environment Configuration and Installation

This is the installation and configuration of the dokuwiki development platform on Windows that we use. slow. Docker with the last WSL2 is really, really slow if you don't work in WSL two environment...
Card Puncher Data Processing
How works the php autoload feature ?

You may have a lot of class that you need to load It's the case when building an object-oriented applications PHP where there is one source file per class definition. You may write a long list of require/includes...



Share this page:
Follow us:
Task Runner