PHPackages                             laminas/laminas-composer-autoloading - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. laminas/laminas-composer-autoloading

ActiveLibrary[Framework](/categories/framework)

laminas/laminas-composer-autoloading
====================================

Sets up Composer-based autoloading for your Laminas modules

3.6.0(2y ago)6889.8k↑20%4[7 PRs](https://github.com/laminas/laminas-composer-autoloading/pulls)2BSD-3-ClausePHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0

Since Dec 31Pushed 2mo ago11 watchersCompare

[ Source](https://github.com/laminas/laminas-composer-autoloading)[ Packagist](https://packagist.org/packages/laminas/laminas-composer-autoloading)[ Docs](https://laminas.dev)[ Fund](https://funding.communitybridge.org/projects/laminas-project)[ RSS](/packages/laminas-laminas-composer-autoloading/feed)WikiDiscussions 3.7.x Synced 1mo ago

READMEChangelog (9)Dependencies (7)Versions (31)Used By (2)

laminas-composer-autoloading
============================

[](#laminas-composer-autoloading)

[![Build Status](https://github.com/laminas/laminas-composer-autoloading/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas/laminas-composer-autoloading/actions/workflows/continuous-integration.yml)[![type-coverage](https://camo.githubusercontent.com/cd4fca7f925fb456d84498ad85271b3cc122ad83e1f22f3f441f89f9edfa3793/68747470733a2f2f73686570686572642e6465762f6769746875622f6c616d696e61732f6c616d696e61732d636f6d706f7365722d6175746f6c6f6164696e672f636f7665726167652e737667)](https://shepherd.dev/github/laminas/laminas-composer-autoloading)[![Psalm level](https://camo.githubusercontent.com/c3b9a737a965d975053c64185cd6a87b1935bb1fc917de6e03fa27dd9f6d858c/68747470733a2f2f73686570686572642e6465762f6769746875622f6c616d696e61732f6c616d696e61732d636f6d706f7365722d6175746f6c6f6164696e672f6c6576656c2e737667)](https://shepherd.dev/github/laminas/laminas-composer-autoloading)

> ## 🇷🇺 Русским гражданам
>
> [](#-русским-гражданам)
>
> Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.
>
> У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.
>
> Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"
>
> ## 🇺🇸 To Citizens of Russia
>
> [](#-to-citizens-of-russia)
>
> We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.
>
> One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.
>
> You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

Introduction
------------

[](#introduction)

The `laminas-composer-autoloading` package provides the following commands for use with [laminas-cli](https://docs.laminas.dev/laminas-cli/):

- `composer:autoload:enable` - add the named module to the project autoloading rules defined in `composer.json`
- `composer:autoload:disable` - remove autoloading rules for the module from `composer.json`

Both commands also dump the autoloading rules on completion.

> ### Upgrading
>
> [](#upgrading)
>
> If you were using the v2 series of this component, the package previously provided its own binary, `laminas-composer-autoloading`. You will now call `laminas composer:autoload:(disable|enable)` instead.

Installation
------------

[](#installation)

Run the following `composer` command:

```
$ composer require --dev "laminas/laminas-composer-autoloading"
```

Note the `--dev` flag; this tool is intended for use in development only.

Usage
-----

[](#usage)

```
# Enable the module "Foo" and autodetermine if PSR-0 or PSR-4 autoloading should be generated
$ ./vendor/bin/laminas composer:autoload:enable Foo
# Enable the module "Bar" using PSR-0 rules
$ ./vendor/bin/laminas composer:autoload:enable Bar --type psr-0
# Disable the module "Baz"
$ ./vendor/bin/laminas composer:autoload:disable Baz
```

Use `laminas help ` to get detailed help about available options and arguments.

### Notes

[](#notes)

- Modules are assumed to have a `src/` directory. If they do not, the autoloading generated will be incorrect.
- If unable to determine the autoloading type, the command raises an exception.
- On enabling autoloading, if the `Module` class file for the module is in the module root, it will be moved to the module's `src/` directory (laminas-mvc applications only).

Examples
--------

[](#examples)

1. Autodetect a module's autoloading type, and generate a Composer autoloading entry for "Status" module.

    ```
    $ ./vendor/bin/laminas composer:autoload:enable Status
    ```
2. Autodetect a module's autoloading type, and remove a Composer autoloading entry for "Status" module.

    ```
    $ ./vendor/bin/laminas composer:autoload:disable Status
    ```
3. Specify PSR-0 for the module type, and generate a Composer autoloading entry for "Status" module.

    ```
    $ ./vendor/bin/laminas composer:autoload:enable --type psr-0 Status
    ```
4. Specify PSR-4 for the module type, and generate a Composer autoloading entry for "Status" module.

    ```
    $ ./vendor/bin/laminas composer:autoload:enable --type psr-4 Status
    ```
5. Specify the path to the composer binary when generating autoloading entry for "Status" module:

    ```
    $ ./vendor/bin/laminas composer:autoload:enable -c composer.phar Status
    ```
6. Specify the path to modules directory, and generate a Composer autoloading entry for "Status" module.

    ```
    $ ./vendor/bin/laminas composer:autoload:enable -m src Status
    ```

###  Health Score

56

—

FairBetter than 98% of packages

Maintenance57

Moderate activity, may be stable

Popularity44

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Recently: every ~112 days

Total

24

Last Release

795d ago

Major Versions

1.1.1 → 2.0.02019-12-31

2.2.x-dev → 3.0.02021-03-29

PHP version history (6 changes)2.0.0PHP ^5.6 || ^7.0

2.2.0PHP ^7.3 || ~8.0.0

3.1.0PHP ^7.3 || ~8.0.0 || ~8.1.0

3.2.0PHP ^7.4 || ~8.0.0 || ~8.1.0

3.4.0PHP ^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0

3.6.0PHP ~8.1.0 || ~8.2.0 || ~8.3.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25943?v=4)[Matthew Weier O'Phinney](/maintainers/weierophinney)[@weierophinney](https://github.com/weierophinney)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (63 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (54 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (50 commits)")[![laminas-bot](https://avatars.githubusercontent.com/u/68250880?v=4)](https://github.com/laminas-bot "laminas-bot (12 commits)")[![gsteel](https://avatars.githubusercontent.com/u/2803720?v=4)](https://github.com/gsteel "gsteel (10 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (6 commits)")[![Xerkus](https://avatars.githubusercontent.com/u/725842?v=4)](https://github.com/Xerkus "Xerkus (5 commits)")[![geerteltink](https://avatars.githubusercontent.com/u/9497586?v=4)](https://github.com/geerteltink "geerteltink (5 commits)")[![ghostwriter](https://avatars.githubusercontent.com/u/9754361?v=4)](https://github.com/ghostwriter "ghostwriter (5 commits)")[![arueckauer](https://avatars.githubusercontent.com/u/1815979?v=4)](https://github.com/arueckauer "arueckauer (2 commits)")[![samsonasik](https://avatars.githubusercontent.com/u/459648?v=4)](https://github.com/samsonasik "samsonasik (1 commits)")

---

Tags

autoloadingclicomposermoduleconsoleframeworklaminasautoloading

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laminas-laminas-composer-autoloading/health.svg)

```
[![Health](https://phpackages.com/badges/laminas-laminas-composer-autoloading/health.svg)](https://phpackages.com/packages/laminas-laminas-composer-autoloading)
```

###  Alternatives

[laminas-api-tools/api-tools-oauth2

Laminas module for implementing an OAuth2 server

112.0M5](/packages/laminas-api-tools-api-tools-oauth2)[laminas-api-tools/api-tools-admin

Laminas API Tools Admin module

13794.3k5](/packages/laminas-api-tools-api-tools-admin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
