Get expert guidance in a few days with a Laravel code review

Installers

composer/installers image

Installers stats

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

View on GitHub →

A multi-framework Composer library installer

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.


Composer Installers Related Articles

Building Package Installers image

Building Package Installers

Read article
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Tinkerwell logo

Tinkerwell

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

Tinkerwell
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
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