PHPackages                             zfcampus/zf-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. zfcampus/zf-composer-autoloading

Abandoned → [laminas/laminas-composer-autoloading](/?search=laminas%2Flaminas-composer-autoloading)ArchivedLibrary[Framework](/categories/framework)

zfcampus/zf-composer-autoloading
================================

Sets up Composer-based autoloading for your Zend Framework modules

2.1.0(8y ago)16919.2k↓39.4%25BSD-3-ClausePHPPHP ^5.6 || ^7.0

Since Aug 12Pushed 6y ago1 watchersCompare

[ Source](https://github.com/zfcampus/zf-composer-autoloading)[ Packagist](https://packagist.org/packages/zfcampus/zf-composer-autoloading)[ Docs](http://apigility.org/)[ RSS](/packages/zfcampus-zf-composer-autoloading/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (6)Versions (6)Used By (5)

zf-composer-autoloading
=======================

[](#zf-composer-autoloading)

> ## Repository abandoned 2019-12-31
>
> [](#repository-abandoned-2019-12-31)
>
> This repository has moved to [laminas/laminas-composer-autoloading](https://github.com/laminas/laminas-composer-autoloading).

[![Build Status](https://camo.githubusercontent.com/ca77a2181ac719c1b0b40b5fe0e0eb89d69224e22325e412df5edc9a4e32b191/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f7a6663616d7075732f7a662d636f6d706f7365722d6175746f6c6f6164696e672e7376673f6272616e63683d6d6173746572)](https://secure.travis-ci.org/zfcampus/zf-composer-autoloading)[![Coverage Status](https://camo.githubusercontent.com/044981b23686a7dfbd6556d51f70fe673386956aa9c233caec649b2443764152/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7a6663616d7075732f7a662d636f6d706f7365722d6175746f6c6f6164696e672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/zfcampus/zf-composer-autoloading?branch=master)

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

[](#introduction)

The `zf-composer-autoloading` package provides a single vendor binary, `zf-composer-autoloading`, which provides following commands:

- `enable` - add the named module to the project autoloading rules defined in `composer.json`, and
- `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 v1 series of this component, the script previously exposed was `autoload-module-via-composer`. That script is now renamed to `zf-composer-autoloading`.

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

[](#installation)

Run the following `composer` command:

```
$ composer require --dev "zfcampus/zf-composer-autoloading"
```

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

Usage
-----

[](#usage)

```
$ ./vendor/bin/zf-composer-autoloading \
> enable|disable \
> [help|--help|-h] \
> [--composer|-c ] \
> [--type|-t ] \
> [--modules-path|-p ] \
> modulename
```

### Commands

[](#commands)

- `enable` - enables composer-based autoloading for the module.
- `disable` - disables composer-based autoloading for the module.

### Arguments

[](#arguments)

- `help`, `--help`, and `-h` each display the script's help message.
- `--composer` and `-c` each allow you to specify the path to the Composer binary, if it is not in your `$PATH`.
- `--type` and `-t` allow you to specify the autoloading type, which should be one of `psr-0` or `psr-4`; if not provided, the script will attempt to auto-determine the value based on the directory structure of the module.
- `--modules-path` and `-p` allow you to specify the path to the modules directory; default to `module`.
- `modulename` is the name of the module for which to setup Composer-based autoloading.

### 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, PSR-0 will be assumed.
- 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 (zend-mvc applications only).

Examples
--------

[](#examples)

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

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

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

    ```
    $ ./vendor/bin/zf-composer-autoloading enable --type psr0 Status
    ```
4. Specify PSR-4 for the module type, and generate a Composer autoloading entry for "Status" module.

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

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

    ```
    $ ./vendor/bin/zf-composer-autoloading enable -p src Status
    ```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 52.6% of commits — single point of failure

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 ~157 days

Total

5

Last Release

2984d ago

Major Versions

1.1.1 → 2.0.02017-02-22

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/296074?v=4)[Zend Framework](/maintainers/zendframework)[@zendframework](https://github.com/zendframework)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (41 commits)")[![michalbundyra](https://avatars.githubusercontent.com/u/7423207?v=4)](https://github.com/michalbundyra "michalbundyra (37 commits)")

---

Tags

consoleframeworkZendFrameworkzfautoloading

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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