A multi-framework Composer library installer

composer/installers image

composer/installers stats

Downloads
76.9M
Stars
1,408
Open Issues
24
Forks
420

View on GitHub →

Summary of composer/installers Laravel Package

The composer/installers package is a utility for PHP package authors that simplifies the installation of packages into the appropriate directory based on the specified package type. It is designed to work seamlessly with Composer and supports a variety of frameworks and content management systems.

Key Features:

  • Automatic Installation: Automatically installs PHP packages into the correct directory based on the defined package type in composer.json.
  • Custom Install Paths: Allows users to define custom installation paths for packages using the installer-paths setting in composer.json.
  • Custom Install Names: Package authors can specify a custom name for the installation directory via the installer-name attribute.
  • Disabling Installers: Provides functionality to disable one or more installers when necessary, preventing conflicts with other installer scripts.
  • Extensive Framework Support: Includes support for numerous frameworks and CMSs, with stable types indicated in bold. (e.g., cakephp-plugin, drupal-core, wordpress-plugin).

Installation:

Install the package via Composer:

composer require composer/installers

Usage:

  1. Define Package Type: Add the package type in your package’s composer.json:

    {
    "type": "cakephp-plugin"
    }
  2. Set Custom Installation Paths: Customize where packages are installed:

    {
    "extra": {
    "installer-paths": {
    "your/custom/path/{$name}/": ["type:wordpress-plugin"]
    }
    }
    }
  3. Naming Custom Installations: For specific naming conventions during installation:

    {
    "extra": {
    "installer-name": "CustomName"
    }
    }
  4. Disabling Specific Installers: To avoid conflicts by disabling certain installers:

    {
    "extra": {
    "installer-disable": ["cakephp", "drupal"]
    }
    }

Notable Considerations:

  • No Dynamic Package Types: The package does not support dynamic package types or paths that could potentially alter or delete important directories without user consent.
  • Recommended Alternatives: For new projects under Composer 2.1+, consider using Composer\InstalledVersions for handling package installations to maintain cleaner vendor directories.

The composer/installers package is essential for developers looking to streamline the setup process for various PHP frameworks and applications, ensuring packages are installed in the correct directories with minimal configuration.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Composer Installers Related Articles

Building Package Installers image

Building Package Installers

Read article
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $2500/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell