PHPackages                             jonathantorres/construct - 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. [CLI &amp; Console](/categories/cli)
4. /
5. jonathantorres/construct

ActiveLibrary[CLI &amp; Console](/categories/cli)

jonathantorres/construct
========================

PHP project/micro-package generator.

v3.0.0(3y ago)26744716[14 issues](https://github.com/jonathantorres/construct/issues)MITPHPPHP ^8.0

Since Apr 25Pushed 3y ago11 watchersCompare

[ Source](https://github.com/jonathantorres/construct)[ Packagist](https://packagist.org/packages/jonathantorres/construct)[ RSS](/packages/jonathantorres-construct/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (35)Used By (0)

Construct
=========

[](#construct)

[![Build Status](https://github.com/jonathantorres/construct/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/jonathantorres/construct/actions/workflows/tests.yml)[![Build Status](https://camo.githubusercontent.com/5df93043936b7d380ced4f9f2173b681a42ae0b7fcbaadd176e6537c416b5bd3/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f6769746875622f6a6f6e617468616e746f727265732f636f6e7374727563743f7376673d74727565)](https://ci.appveyor.com/project/jonathantorres/construct)[![Version](https://camo.githubusercontent.com/7bcc973b5e762b11e144ca33aa5b83512f02f285c1832e2ad849b0b032afff8e/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6f6e617468616e746f727265732f636f6e7374727563742e7376673f7374796c653d666c6174)](https://packagist.org/packages/jonathantorres/construct)[![PDS Skeleton](https://camo.githubusercontent.com/3c7140ee36205075ed977142f25c29eb1fb7809e9b86a865461fc21776ad1665/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e7376673f7374796c653d666c6174)](https://github.com/php-pds/skeleton)

A PHP project/micro-package generator for [PDS](http://php-pds.com/) compliant projects or micro-packages.

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

[](#installation)

Construct should be installed globally through composer.

```
composer global require jonathantorres/construct
```

Make sure that `~/.composer/vendor/bin` is on your `$PATH`. This way the `construct` executable can be located.

Assumptions
-----------

[](#assumptions)

As Construct utilizes Composer's CLI, it's assumed that Composer is installed. When using the option to initialize an empty Git repo (i.e. `--git` or `-g`) it's also assumed that Git is installed.

Usage
-----

[](#usage)

Just run `construct generate` with your `vendor/package` declaration and it will construct a basic PHP project into the `package` directory. For example, if you run `construct generate jonathantorres/logger` it will generate a basic project structure inside the `logger` folder.

```
construct generate jonathantorres/logger
```

The generated project structure will look like the following `tree` excerpt. Files and directories in parentheses are optional.

```
├── logger
│   ├── CHANGELOG.md
│   ├── (CONDUCT.md)
│   ├── composer.json
│   ├── composer.lock
│   ├── CONTRIBUTING.md
│   ├── (.appveyor.yml)
│   ├── (.editorconfig)
│   ├── (.env)
│   ├── (.env.example)
│   ├── (.git)
│   │   └── ...
│   ├── .gitattributes
│   ├── (.github)
│   │   ├── CONTRIBUTING.md
│   │   ├── ISSUE_TEMPLATE.md
│   │   └── PULL_REQUEST_TEMPLATE.md
│   ├── .gitignore
│   ├── .gitmessage
│   ├── (.lgtm)
│   ├── (bin)
│   │   └── cli-script
│   ├── LICENSE.md
│   ├── (MAINTAINERS)
│   ├── (.php_cs)
│   ├── (phpunit.xml.dist)
│   ├── README.md
│   ├── (docs)
│   │   └── index.md
│   ├── src
│   │   └── Logger.php
│   ├── tests
│   │   └── LoggerTest.php
│   ├── .travis.yml
│   ├── (Vagrantfile)
│   └── vendor
│           └── ...

```

This is a good starting point. You can continue your work from there.

Select testing framework
------------------------

[](#select-testing-framework)

The `--test-framework` or `--test` option will allow you to select a testing framework. One of the following is available at the moment: `phpunit`, `phpspec`, `codeception` or `behat`. `phpunit` is currently the default.

```
construct generate jonathantorres/logger --test-framework=codeception
```

You can also use the short option `-t`.

```
construct generate jonathantorres/logger -t codeception
```

Select license
--------------

[](#select-license)

The `--license` option will allow you to select a license for the project to construct. One of the following is available at the moment: `MIT`, `Apache-2.0`, `GPL-2.0` or `GPL-3.0`. `MIT` is currently the default.

```
construct generate jonathantorres/logger --license=Apache-2.0
```

You can also use the short option `-l`.

```
construct generate jonathantorres/logger -l Apache-2.0
```

Specify a namespace
-------------------

[](#specify-a-namespace)

The `--namespace` option will allow you to specify a namespace for the project to construct. This is totally optional. By default construct will use the package name as the namespace.

```
construct generate jonathantorres/logger --namespace=JonathanTorres\\Projects\\Logger
```

You can also use the short option `-s`.

```
construct generate jonathantorres/logger -s JonathanTorres\\Projects\\Logger
```

Specify a CLI framework
-----------------------

[](#specify-a-cli-framework)

The optional `--cli-framework` option will allow you to specify a CLI framework for the project to construct, while also creating a bin directory with an initial CLI script in it, adding a bin key in the project's composer.json, and an initial [AppVeyor](https://www.appveyor.com) configuration. When the option has been set without a CLI composer package the `symfony/console` package will be used per default. There's no short option available.

```
construct generate jonathantorres/logger --cli-framework=zendframework/zend-console
```

Specify PHP version
-------------------

[](#specify-php-version)

The `--php` option will allow you to specify the minimum required PHP version that your project will support. Construct will use the currently installed version if not specified.

```
construct generate jonathantorres/logger --php=5.6.31
```

Specify Composer keywords
-------------------------

[](#specify-composer-keywords)

The optional `--keywords` option will allow you to specify a comma separated list of [Composer keywords](https://getcomposer.org/doc/04-schema.md#keywords).

```
construct generate jonathantorres/logger --keywords=log,logging
```

You can also use the short option `-k`.

```
construct generate jonathantorres/logger -k=log,logging
```

Initialize an empty Git repo?
-----------------------------

[](#initialize-an-empty-git-repo)

The `--git` option will allow you to initialize an empty Git repository inside the constructed project.

```
construct generate jonathantorres/logger --git
```

You can also use the short option `-g`.

```
construct generate jonathantorres/logger -g
```

Generate a PHP Coding Standards Fixer configuration?
----------------------------------------------------

[](#generate-a-php-coding-standards-fixer-configuration)

The `--phpcs` option will generate a [PHP Coding Standards Fixer](http://cs.sensiolabs.org/) configuration within the constructed project and add a Travis CI script for validation during builds. The generated `.php_cs` configuration defaults to the `PSR-2` coding style guide.

```
construct generate jonathantorres/logger --phpcs
```

You can also use the short option `-p`.

```
construct generate jonathantorres/logger -p
```

Generate a Vagrantfile?
-----------------------

[](#generate-a-vagrantfile)

The `--vagrant` option will generate a basic [Vagrantfile](https://docs.vagrantup.com/v2/vagrantfile/index.html) within the constructed project, defaulting to the output of a `vagrant init` call plus a minimal [vagrant-cachier](http://fgrehm.viewdocs.io/vagrant-cachier) plugin configuration. There's no short option available.

```
construct generate jonathantorres/logger --vagrant
```

Generate an EditorConfig configuration?
---------------------------------------

[](#generate-an-editorconfig-configuration)

The `--editor-config` option will generate an [EditorConfig](http://editorconfig.org) configuration within the constructed project.

```
construct generate jonathantorres/logger --editor-config
```

You can also use the short option `-e`.

```
construct generate jonathantorres/logger -e
```

Generate .env enviroment files?
-------------------------------

[](#generate-env-enviroment-files)

The `--env` option will generate [.env](https://github.com/vlucas/phpdotenv) environment files within the constructed project for keeping `sensitive` information out of it. There's no short option available.

```
construct generate jonathantorres/logger --env
```

Generate LGTM configuration files?
----------------------------------

[](#generate-lgtm-configuration-files)

The `--lgtm` option will generate [LGTM](https://lgtm.co) configuration files within the constructed project. There's no short option available.

```
construct generate jonathantorres/logger --lgtm
```

Generate common GitHub files?
-----------------------------

[](#generate-common-github-files)

The `--github` option will generate common GitHub (i.e. `templates` and `docs`) files. There's no short option available.

```
construct generate jonathantorres/logger --github
```

Generate GitHub template files?
-------------------------------

[](#generate-github-template-files)

The `--github-templates` option will generate [GitHub template](https://github.com/blog/2111-issue-and-pull-request-templates) files within the constructed project into a folder conventionally named `.github`. It also will move `CONTRIBUTING.md` into it. There's no short option available, but the option is implicated with the `github` option.

```
construct generate jonathantorres/logger --github-templates
```

Generate GitHub documentation files?
------------------------------------

[](#generate-github-documentation-files)

The `--github-docs` option will generate [GitHub documentation](https://github.com/blog/2233-publish-your-project-documentation-with-github-pages) files within the constructed project into a folder conventionally named `docs`. There's no short option available, but the option is implicated with the `github` option.

```
construct generate jonathantorres/logger --github-docs
```

Generate a Code of Conduct?
---------------------------

[](#generate-a-code-of-conduct)

The `--code-of-conduct` option will generate a Code of Conduct file named `CONDUCT.md` within the constructed project and also add a reference to it in the generated `README.md`. The used Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.4. There's no short option available.

```
construct generate jonathantorres/logger --code-of-conduct
```

Use a configuration for recurring settings
------------------------------------------

[](#use-a-configuration-for-recurring-settings)

The `--config` option allows the usage of a configuration file in the `YAML` format. There are two ways to provide such a configuration file: One is to provide a specific file as an option argument, the other is to put a `.construct` configuration file in the home directory of your system. For the structure of a configuration file have a look at the [.construct](example/.construct) example file. When no configuration keys are provided for settings having a default value (i.e. `test-framework`, `license`, `php`) their default value is used.

```
construct generate jonathantorres/logger --config /path/to/config.yml
```

You can also use the short option `-c`.

```
construct generate jonathantorres/logger -c /path/to/config.yml
```

When there's a `.construct` configuration file in your home directory it will be used per default. If required it's possible to disable the usage via the `--ignore-default-config` option or the equivalent short option `-i`.

Interactive Mode
----------------

[](#interactive-mode)

This mode will ask you all the required (and optional) information to generate your project.

```
construct generate:interactive
```

Running tests
-------------

[](#running-tests)

```
composer construct:test
```

License
-------

[](#license)

This library is licensed under the MIT license. Please see [LICENSE](LICENSE.md) for more details.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more details.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for more details.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 74.7% 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 ~85 days

Recently: every ~457 days

Total

34

Last Release

1213d ago

Major Versions

1.x-dev → v2.0.02018-04-01

v2.1.0 → v3.0.02023-01-22

PHP version history (5 changes)v1.2.0PHP &gt;=5.4.0

v1.6.0PHP ^5.4 || ^7.0

v1.16.0PHP ^5.6 || ^7.0

v2.0.0PHP ^7.0

v3.0.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/1ce2b58ac5128f6b7bd2492f593f561a50b5de982f2add14548b9ae5a0b4e46c?d=identicon)[jonathantorres](/maintainers/jonathantorres)

---

Top Contributors

[![jonathantorres](https://avatars.githubusercontent.com/u/195615?v=4)](https://github.com/jonathantorres "jonathantorres (547 commits)")[![raphaelstolt](https://avatars.githubusercontent.com/u/48225?v=4)](https://github.com/raphaelstolt "raphaelstolt (173 commits)")[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (6 commits)")[![mikeSimonson](https://avatars.githubusercontent.com/u/907613?v=4)](https://github.com/mikeSimonson "mikeSimonson (2 commits)")[![piotr-zuralski](https://avatars.githubusercontent.com/u/20515925?v=4)](https://github.com/piotr-zuralski "piotr-zuralski (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")[![Swader](https://avatars.githubusercontent.com/u/1430603?v=4)](https://github.com/Swader "Swader (1 commits)")[![waffle-iron](https://avatars.githubusercontent.com/u/6912981?v=4)](https://github.com/waffle-iron "waffle-iron (1 commits)")

---

Tags

clipackagephpprojectstructurephpclipackagestructureproject

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[seregazhuk/php-watcher

Automatically restart PHP application once the source code changes

394137.8k4](/packages/seregazhuk-php-watcher)[mahocommerce/maho

Free and open source ecommerce platform, created in 2024 on the M1 platform, PHP 8.3+

1322.1k12](/packages/mahocommerce-maho)[stolt/lean-package-validator

Library and CLI for validating if a project or package has and will have lean releases.

172.4k8](/packages/stolt-lean-package-validator)

PHPackages © 2026

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