PHPackages                             producer/producer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. producer/producer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

producer/producer
=================

Tools for releasing library packages; supports Git, Mercurial, Github, Gitlab, and Bitbucket.

2.3.0(8y ago)10418.7k↑1387.5%6[3 issues](https://github.com/producerphp/producer.producer/issues)[1 PRs](https://github.com/producerphp/producer.producer/pulls)2MITPHPPHP &gt;=5.6.0

Since Mar 19Pushed 2y ago10 watchersCompare

[ Source](https://github.com/producerphp/producer.producer)[ Packagist](https://packagist.org/packages/producer/producer)[ Docs](https://github.com/producerphp/producer.producer)[ RSS](/packages/producer-producer/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (8)Used By (2)

Producer
========

[](#producer)

Producer is a command-line quality-assurance tool to validate, and then release, your PHP library package. It supports Git and Mercurial for version control, as well as Github, Gitlab, and Bitbucket for remote origins (including self-hosted origins).

Installing
----------

[](#installing)

Producer works in concert with [Composer](https://getcomposer.org), [PHPUnit](https://packagist.org/packages/phpunit/phpunit), and [PHPDocumentor](https://packagist.org/packages/phpdocumentor/phpdocumentor). Please install them first, either as part of your global system, or as part of your package.

### Global Install

[](#global-install)

To install Producer globally, issue `composer global require producer/producer`.

Be sure to add `$COMPOSER_HOME/vendor/bin` to your `$PATH`; [instuctions here](https://getcomposer.org/doc/03-cli.md#global).

Test the installation by issuing `producer` at the command line to see some "help" output.

> Remember, you will need [PHPUnit](https://packagist.org/packages/phpunit/phpunit) and [PHPDocumentor](https://packagist.org/packages/phpdocumentor/phpdocumentor) as well.

### Package Install

[](#package-install)

To install the Producer package as a development requirement for your package issue `composer require --dev producer/producer`.

Test the installation by issuing `./vendor/bin/producer` at the command line to see some "help" output.

> Remember, you will need [PHPUnit](https://packagist.org/packages/phpunit/phpunit) and [PHPDocumentor](https://packagist.org/packages/phpdocumentor/phpdocumentor) as well.

Configuring
-----------

[](#configuring)

Before you get going, you'll need to create a `~/.producer/config` file. Copy and paste the following into your terminal:

```
mkdir ~/.producer

echo "; Github
github_username =
github_token =

; Gitlab
gitlab_token =

; Bitbucket
bitbucket_username =
bitbucket_password =" > ~/.producer/config

```

You can then edit `~/.producer/config` to enter your access credentials, any or all of:

- [Github personal API token](https://github.com/settings/tokens),
- [Gitlab private token](https://gitlab.com/profile/account), or
- Bitbucket username and password.

> WARNING: Saving your username and password for Bitbucket in plain text is not very secure. Bitbucket doesn't have personal API tokens, so it's either "username and password" or bring in an external OAuth1 library with all its dependencies just to authenticate to Bitbucket. The latter option might show up in a subsequent release.

### Package Configuration

[](#package-configuration)

Inside your package repository, you may define a `.producer/config` file that sets any of the following options for that specific package.

```
; custom @package docblock value
package = Custom.Name

; custom hostnames for self-hosted origins
github_hostname = example.com
gitlab_hostname = example.net
bitbucket_hostname = example.org

; commands to use for phpunit and phpdoc
[commands]
phpunit = /path/to/phpunit
phpdoc = /path/to/phpdoc

; names for support files
[files]
changes = CHANGES.md
contributing = CONTRIBUTING.md
license = LICENSE.md
phpunit = phpunit.xml.dist
readme = README.md
```

> **Testing Systems**: If you want to use a testing system other than PHPUnit, you can set `phpunit = /whatever/you/want`. As long as it exits non-zero when the tests fail, Producer will work with it properly. Yes, it was short-sighted to name the key `phpunit`; a future release of Producer may remedy that.

Getting Started
---------------

[](#getting-started)

Now that you have Producer installed and configured, change to the directory for your library package repository. From there, you can call the following commands:

- `producer issues` will show all the open issues from the remote origin
- `producer phpdoc` will check the PHP docblocks in the `src/` directory
- `producer validate ` will validate the package for release, but won't actually release it
- `producer release ` will validate, and then actually release, the package

> NOTE: Producer reads the `.git` or `.hg` configuration data from the repository, so it knows whether you are using Github, Gitlab, or Bitbucket as the remote origin.

Validating
----------

[](#validating)

When you validate the library package, Producer will:

- Sync with the remote origin (i.e., pull from the remote origin, then push any local changes, then check the local status to make sure everything is committed and pushed)
- Validate the composer.json file
- Check for informational files (see below) and for a `phpunit.xml.dist` file
- Check that the license file has the current year in it
- Call `composer update`, run the unit tests, and make sure they cleaned up after
- Check that the PHP docblocks in the `src/` directory are valid (see below)
- Check that the changes file is in the most-recent commit to the repository

If any of those fails, then the package is not considered valid for release.

In addition, the `validate` command will show any open issues from the remote origin, but these are presented only as a reminder, and will not be considered invalidators.

### Informational Files

[](#informational-files)

Producer wants you to have these informational files in the package root:

- `CHANGES.md`, a list of changes for the release;
- `CONTRIBUTING.md`, describing how to contribute to the library;
- `LICENSE.md`, the package licensing text; and,
- `README.md`, an introduction to the library.

You may override these file names by setting the appropriate `.producer/config`directives.

### Docblocks

[](#docblocks)

Producer will not attempt to check docblocks for 0.\*, -dev, or -alpha releases. It seems reasonable to expect that the codebase is not ready for documenting before a beta release.

Releasing
---------

[](#releasing)

When you `release` the package, Producer will first `validate` it as a pre-flight step.

Then it will use the Github or Gitlab API to create a release. In the case of Bitbucket (which does not have an API for releases) it will tag the repository locally.

Finally, Producer will sync with the remote origin so that the release is represented locally, and/or pushed to the remote.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity63

Established project with proven stability

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

Recently: every ~680 days

Total

8

Last Release

948d ago

Major Versions

1.0.0 → 2.0.02016-04-19

1.x-dev → 2.1.02016-04-30

2.x-dev → 3.x-dev2023-10-13

PHP version history (2 changes)1.0.0PHP &gt;=5.6.0

3.x-devPHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25754?v=4)[Paul M. Jones](/maintainers/pmjones)[@pmjones](https://github.com/pmjones)

---

Top Contributors

[![cxj](https://avatars.githubusercontent.com/u/446131?v=4)](https://github.com/cxj "cxj (2 commits)")[![pmjones](https://avatars.githubusercontent.com/u/25754?v=4)](https://github.com/pmjones "pmjones (2 commits)")[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (1 commits)")[![svpernova09](https://avatars.githubusercontent.com/u/967362?v=4)](https://github.com/svpernova09 "svpernova09 (1 commits)")

---

Tags

packagelibrarybitbucketgithubgitlabgitmercurialhg

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/producer-producer/health.svg)

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

###  Alternatives

[laravelplus/laravel-updater

A Laravel package for syncing with upstream repositories (GitHub, GitLab, Bitbucket, etc.)

201.7k](/packages/laravelplus-laravel-updater)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[enomotodev/php-cs-fixer-commit

Create commit of php-cs-fixer

18117.3k](/packages/enomotodev-php-cs-fixer-commit)

PHPackages © 2026

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