Skip to content

PHP Package Manager

September 29, 2023
March 27, 2023

Composer

Composer 2012, inspired by npm, with composer.json and per-project ./vendor/
Composer Docs
jakoch/awesome-composer: A curated awesome list for Composer, Packagist, Satis, Plugins, Scripts, Composer related resources, tutorials.
Composer (software) - Wikiwand
How to Install and Use PHP Composer on Linux Distributions

{
  "require": {
    "vendor/package": "1.3.2",
    "vendor/package2": "1.*",
    "vendor/package3": "^2.0.3"
  }
}

Basic usage - Composer

composer diagnose

# add package
composer require <pacakage>

# add global package
composer global require <pacakage>

Global package location:

Packagist repository

Autoloader

PSR-0: Autoloading Standard - PHP-FIG
PSR-4: Autoloader - PHP-FIG
Basic usage Autoloading - Composer
Autoloader optimization - Composer

<?php

require __DIR__ . "/vendor/autoload.php";

// your app code

?php>

PEAR

obsolete

PEAR - PHP Extension and Application Repository 1999, global pear/
PEAR - Wikiwand