You are reading the documentation for the v2.x version. Switch to the current version v1.x.

Packages

Last updated: Tue, 08 Jun 2021 00:39

Packages are available to simplify the integration of some functionality in project without fastidious configuration.

They are also the specificity to be able to used instead of middleware with implementation of PSR-15.

Installation of a package

If the package respect our recommendations, the installation is automatic ; but you can also declare package manually.

Manual installation of a package

  1. Use composer to install package:

    composer require berlioz/my-package
    
  2. If you have a packages.json file in your configuration directory, go to 4. Else, create a file named packages.json in your configuration directory and add the default content:

    {
        "packages": []
    }
    
  3. Add package to the packages.json file of your project, looks like:

    {
        "packages": [
            "Berlioz\\Package\\MyPackage\\ClassOfMyPackage"
        ]
    }
    
  4. Finished!