PHPackages                             mikemix/zf-deploy - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. mikemix/zf-deploy

AbandonedLibrary[DevOps &amp; Deployment](/categories/devops)

mikemix/zf-deploy
=================

Deployment tool for ZF2 application

1.0.4(11y ago)028BSD-3-ClausePHPPHP &gt;=5.3.23

Since Apr 24Pushed 11y agoCompare

[ Source](https://github.com/mikemix/zf-deploy)[ Packagist](https://packagist.org/packages/mikemix/zf-deploy)[ Docs](http://framework.zend.com/)[ RSS](/packages/mikemix-zf-deploy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (9)Used By (0)

ZFDeploy - deploy ZF2 applications
==================================

[](#zfdeploy---deploy-zf2-applications)

[![Build Status](https://camo.githubusercontent.com/d22f0eefdb16bad39e1464c62e6b820feea8be14174e14bca43c9ce18ac07465/68747470733a2f2f7472617669732d63692e6f72672f7a6663616d7075732f7a662d6465706c6f792e706e67)](https://travis-ci.org/zfcampus/zf-deploy)

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

[](#introduction)

**ZFDeploy** is a command line tool to deploy [Zend Framework 2](http://framework.zend.com) applications.

This tool produces a file package ready to be deployed. The tool supports the following format: ZIP, TAR, TGZ (.TAR.GZ), .ZPK (the deployment file format of [Zend Server 6](http://files.zend.com/help/Zend-Server/zend-server.htm#understanding_the_package_structure.htm)).

Requirements
------------

[](#requirements)

Please see the [composer.json](composer.json) file.

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

[](#installation)

ZFDeploy may be installed in two ways: as a standalone, updatable `phar` file, or via Composer.

### Standalone PHAR installation

[](#standalone-phar-installation)

The standalone `phar` file is available at:

-

You can retrieve it using any of the following commands.

Via `curl`:

```
$ curl -o zfdeploy.phar https://packages.zendframework.com/zf-deploy/zfdeploy.phar
```

Via `wget`:

```
$ wget https://packages.zendframework.com/zf-deploy/zfdeploy.phar
```

Or using your installed PHP binary:

```
$ php -r "file_put_contents('zfdeploy.phar', file_get_contents('https://packages.zendframework.com/zf-deploy/zfdeploy.phar'));"
```

Once you have the file, make it executable; in Unix-like systems:

```
$ chmod 755 zfdeploy.phar
```

You can update the `phar` file periodically to the latest version using the `self-update` command:

```
$ zfdeploy.phar self-update
```

### Composer installation

[](#composer-installation)

Run the following `composer` command:

```
$ composer require "zfcampus/zf-deploy:~1.0-dev"
```

Alternately, manually add the following to your `composer.json`, in the `require` section:

```
"require": {
    "zfcampus/zf-deploy": "~1.0-dev"
}
```

And then run `composer update` to ensure the module is installed.

If installed via composer, the script lives in `vendor/bin/zfdeploy.php` of your application.

Usage
-----

[](#usage)

> ### Note
>
> [](#note)
>
> If you clone this project standalone, the script is located in `bin/zfdeploy.php`. If you install this repository as a Composer dependency of your project, the script is located in `vendor/bin/zfdeploy.php`. If you install using the `phar` file, you will either need to put it on your path or provide the full path to the `phar` file; the script name then is `zfdeploy.phar`.
>
> Depending on your environment, you may need to execute the `phar` file or `php` script using your `php` executable:
>
> ```
> $ php bin/zfdeploy.php
> $ php vendor/bin/zfdeploy.php
> $ php zfdeploy.phar
> ```
>
>
>
> In most Unix-like systems, if you have `/usr/bin/env` available, both the script and `phar` file should be self-executable.
>
> For our examples, we will reference the script as `zfdeploy`, regardless of how you installed it or how you determine you will need to execute it.

The command line tool can be executed using the following command:

```
$ zfdeploy build
```

where `` is the filename of the output package to produce. When run with no other arguments, it assumes the current directory should be packaged; if you want to specify a different directory for packaging, use the `--target` flag:

```
$ zfdeploy build  --target path/to/application
```

You can specify the file format directly in the `` using the proper extension (e.g. `application.zip` will create a ZIP file).

`zfdeploy` includes the following commands:

```
$ zfdeploy
ZFDeploy, version 0.3.0-dev

Available commands:

 build          Build a deployment package
 help           Get help for individual commands
 self-update    Updates zfdeploy.phar to the latest version
 version        Display the version of the script
```

The full syntax of the `build` command includes:

```
Usage:
 build  [--target=] [--modules=] [--vendor|-v]:vendor [--composer=] [--gitignore=] [--deploymentxml=] [--zpkdata=] [--version=]

Arguments:
       Name of the package file to create; suffix must be .zip, .tar, .tar.gz, .tgz, or .zpk
 --target       The target directory of the application to package; defaults to current working directory
 --modules      Comma-separated list of modules to include in build
 --vendor|-v    Whether or not to include the vendor directory (disabled by default)
 --composer     Whether or not to execute composer; "on" or "off" ("on" by default)
 --gitignore    Whether or not to parse the .gitignore file to determine what files/folders to exclude; "on" or "off" ("on" by default)
 --configs      Path to directory containing application config files to include in the package
 --deploymentxmlPath to a custom deployment.xml to use when building a ZPK package
 --zpkdata      Path to a directory containing ZPK package assets (deployment.xml, logo, scripts, etc.)
 --version      Specific application version to use for a ZPK package
```

This deployment tool takes care of the local configuration files, related to the specific environment, using the `.gitignore` file. If your applications use the `.gitignore` file to exclude local configuration files, for instance the `local.php` file in the `/config/autoload` folder, **ZFdeploy** will not include these files in the deployment package. You can disable the usage of the `.gitignore` file using the `--gitignore off` option.

> ### NOTE: if you disable the .gitignore usage
>
> [](#note-if-you-disable-the-gitignore-usage)
>
> If you disable the `.gitignore` using the `--gitignore off` option, all the files of the ZF2 application will be included in the package. **That means local configuration files, including sensitive information like database credentials, are deployed in production!!!** Please consider this behaviour before switching off the gitignore option.

Another important part of the deployment of a ZF2 application is the usage of [composer](https://getcomposer.org).

**ZFDeploy** executes the following composer command during the creation of the deployment package:

```
$ php composer.phar install --no-dev --prefer-dist --optimize-autoloader
```

The `--no-dev` flag ensures that development packages are not installed in the production environment. The `--prefer-dist` option tell composer to install from dist if possible. This can speed up installs substantially on build servers and other use cases where you typically do not run updates of the vendors The `--optimize-autoloader` flag makes Composer's autoloader more performant by building a "class map".

For more information about Composer, you can read the [Documentation](https://getcomposer.org/doc/)page of the project.

> ### Note: production configuration
>
> [](#note-production-configuration)
>
> Zend Framework 2 applications often include `{,*.}local.php` files in `config\autoload/`, which are used to provide environment specific configuration. (In Apigility, this may include database configuration, Authentication configuration, etc.). These files are omitted from version control via `.gitignore` directives -- and, by default, from packaging.
>
> The settings you want for production will often differ from those in your development environment, and you may push them to production in a variety of ways -- via Chef, Puppet, Ansible, etc. Another option is to use the `--configs` flag when building your package. You can pass a directory containing production configuration files, and these will then be included in your deployment package.

Getting help
------------

[](#getting-help)

The `help` command can list both the available commands, as well as provide the syntax for each command:

- `zfdeploy help` will list all commands available.
- `zfdeploy help ` will show usage for the named command.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 80% 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 ~53 days

Recently: every ~77 days

Total

7

Last Release

4085d ago

Major Versions

0.2.0 → 1.0.0-beta32014-04-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f120faf0f68744fbc357d36e55bb78ec43fa3c2c81eb70f476893540ef1621f?d=identicon)[mikemix](/maintainers/mikemix)

---

Top Contributors

[![weierophinney](https://avatars.githubusercontent.com/u/25943?v=4)](https://github.com/weierophinney "weierophinney (116 commits)")[![ezimuel](https://avatars.githubusercontent.com/u/475967?v=4)](https://github.com/ezimuel "ezimuel (25 commits)")[![kaloyan-raev](https://avatars.githubusercontent.com/u/468091?v=4)](https://github.com/kaloyan-raev "kaloyan-raev (2 commits)")[![neeckeloo](https://avatars.githubusercontent.com/u/1768645?v=4)](https://github.com/neeckeloo "neeckeloo (1 commits)")[![roheim](https://avatars.githubusercontent.com/u/297956?v=4)](https://github.com/roheim "roheim (1 commits)")

---

Tags

zendzf2apigility

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mikemix-zf-deploy/health.svg)

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

###  Alternatives

[aws/aws-sdk-php-zf2

Zend Framework 2 Module that allows easy integration the AWS SDK for PHP

104997.5k5](/packages/aws-aws-sdk-php-zf2)[facile-it/sentry-module

This module allows integration of Sentry Client into laminas and mezzio

19372.5k](/packages/facile-it-sentry-module)[webino/webino-image-thumb

Image Thumbnailer for Zend Framework 2

4079.0k](/packages/webino-webino-image-thumb)

PHPackages © 2026

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