A PHP project/micro-package generator for PDS compliant projects or micro-packages.

Overview

Construct

Build Status Build Status Version PDS Skeleton

A PHP project/micro-package generator for PDS compliant projects or micro-packages.

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

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

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

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

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

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

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 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

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

The optional --keywords option will allow you to specify a comma separated list of Composer 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?

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?

The --phpcs option will generate a PHP Coding Standards Fixer 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?

The --vagrant option will generate a basic Vagrantfile within the constructed project, defaulting to the output of a vagrant init call plus a minimal vagrant-cachier plugin configuration. There's no short option available.

construct generate jonathantorres/logger --vagrant

Generate an EditorConfig configuration?

The --editor-config option will generate an EditorConfig 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?

The --env option will generate .env 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?

The --lgtm option will generate LGTM configuration files within the constructed project. There's no short option available.

construct generate jonathantorres/logger --lgtm

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?

The --github-templates option will generate GitHub template 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?

The --github-docs option will generate GitHub documentation 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?

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, version 1.4. There's no short option available.

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

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 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

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

construct generate:interactive

Running tests

composer construct:test

License

This library is licensed under the MIT license. Please see LICENSE for more details.

Changelog

Please see CHANGELOG for more details.

Contributing

Please see CONTRIBUTING for more details.

Comments
  • Cannot install due to dependencies  symfony/finder multi version [v2.6.0, v2.7.3].

    Cannot install due to dependencies symfony/finder multi version [v2.6.0, v2.7.3].

    $ composer global require jonathantorres/construct Changed current directory to E:/users/sunel.saminathan/AppData/Roaming/Composer Using version ^1.4 for jonathantorres/construct ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

    Problem 1 - Conclusion: don't install jonathantorres/construct v1.4.1 - Conclusion: remove symfony/finder v2.7.3 - Installation request for jonathantorres/construct ^1.4 -> satisfiable by j onathantorres/construct[v1.4.0, v1.4.1]. - Conclusion: don't install symfony/finder v2.7.3 - jonathantorres/construct v1.4.0 requires illuminate/filesystem 5.0.* -> sa tisfiable by illuminate/filesystem[v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v 5.0.33, v5.0.4]. - illuminate/filesystem v5.0.0 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2.6 .5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.22 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2. 6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.25 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2. 6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.26 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2. 6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.28 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2. 6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.33 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2. 6.5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - illuminate/filesystem v5.0.4 requires symfony/finder 2.6.* -> satisfiable by symfony/finder[v2.6.0, v2.6.1, v2.6.10, v2.6.11, v2.6.2, v2.6.3, v2.6.4, v2.6 .5, v2.6.6, v2.6.7, v2.6.8, v2.6.9]. - Can only install one of: symfony/finder[v2.6.0, v2.7.3]. - Can only install one of: symfony/finder[v2.6.1, v2.7.3]. - Can only install one of: symfony/finder[v2.6.10, v2.7.3]. - Can only install one of: symfony/finder[v2.6.11, v2.7.3]. - Can only install one of: symfony/finder[v2.6.2, v2.7.3]. - Can only install one of: symfony/finder[v2.6.3, v2.7.3]. - Can only install one of: symfony/finder[v2.6.4, v2.7.3]. - Can only install one of: symfony/finder[v2.6.5, v2.7.3]. - Can only install one of: symfony/finder[v2.6.6, v2.7.3]. - Can only install one of: symfony/finder[v2.6.7, v2.7.3]. - Can only install one of: symfony/finder[v2.6.8, v2.7.3]. - Can only install one of: symfony/finder[v2.6.9, v2.7.3]. - Installation request for symfony/finder == 2.7.3.0 -> satisfiable by symfo ny/finder[v2.7.3].

    Installation failed, reverting ./composer.json to its original content.

    opened by sunel 10
  • Add PHP 7.2 into the mix

    Add PHP 7.2 into the mix

    Added PHP 7.2 support and also eased the AppVeyor configuration. Both for the generated configuration files as well for the own repository configurations.

    opened by raphaelstolt 6
  • Revealed intent with intermediate --test-framework option. Closes #96.

    Revealed intent with intermediate --test-framework option. Closes #96.

    Introduced intermediate test-framework option. Option test should be removed in a future release and the short option t should than be moved to the test-frameworkoption.

    opened by raphaelstolt 4
  • Initial configuration feature implementation. Closes #86.

    Initial configuration feature implementation. Closes #86.

    Currently lacks the feature to overwrite single options provided to the ConstructCommand, which requires to modify variations directly in the .construct configuration file.

    Also changed the option name from the proposed --configuration to --config. It's also possible to disable the usage of the default .construct configuration file via the --ignore-default-config option or its equivalent short option -i.

    opened by raphaelstolt 4
  • Add ability to configure Git commit message template. Closes #144.

    Add ability to configure Git commit message template. Closes #144.

    • A .gitmessage template is copied into the project's root directory
    • To improve the commit message quality and consistency it can be enabled via a Composer script
    opened by raphaelstolt 3
  • Rename test option to test-framework

    Rename test option to test-framework

    To avoid a confusion with the activity testing we should prolly rename the long option to testing-framework, also aligns it with the used configuration key.

    opened by raphaelstolt 3
  • It's possible to select a PHP version greater than the one the project is constructed on

    It's possible to select a PHP version greater than the one the project is constructed on

    This leads to problems (like shown in the following console excerpt) when doing the composer install.

    Creating your project...
    Loading composer repositories with package information
    Installing dependencies (including require-dev)
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - This package requires php >=5.6.0 but your PHP version (5.5.9) does not satisfy that requirement.
    
    bug 
    opened by raphaelstolt 3
  • Installation failure due to package requirement resolution conflict

    Installation failure due to package requirement resolution conflict

    screenshot from 2015-08-29 22 48 47

    I have two other composer packages globally installed (namely fabpot/php-cs-fixer and laravel/installer) that have "symfony/console": "~2.3" as their requirement.

    What is the best way to go about this?

    opened by sasindumendis 3
  • Advise against using PHP notations in micro-packages.

    Advise against using PHP notations in micro-packages.

    Additional validation against using 'php' as part of the project or package name to avoid redundancy (e.g. vendorname/php-markdown). Doesn't halt construction by just displaying a relevant warning.

    opened by raphaelstolt 3
  • interactive mode

    interactive mode

    would be great to have a interactive mode where construct asks the user for all required (and also optional information) with some sane defaults pre-selected

    feature 
    opened by staabm 3
  • Add Composer script descriptions. Closes #215.

    Add Composer script descriptions. Closes #215.

    Adds Composer script descriptions to generated projects/packages and also adds namespaced Composer scripts and their descriptions for the internal Composer scripts.

    Due to a dependency bump to Composer ^1.6.0 the last two commits might require a 2.0.0 release.

    opened by raphaelstolt 2
  • Add support for repositories hosted on BitBucket

    Add support for repositories hosted on BitBucket

    To also support users opting for GitLab, it would be useful to aid them in constructing a package structure targeted for GitLab. This could be done by introducing a --profile or similar named option which excepts bitbucket or other as a value, with github being the default.

    opened by ghost 0
  • The .construct configuration should (also) be loaded from $HOME/.config

    The .construct configuration should (also) be loaded from $HOME/.config

    The .construct configuration should (also) be loaded from $HOME/.config and it should be recommended in the README.md to put it there instead of directly into $HOME.

    opened by raphaelstolt 0
  • Add an option to add PHP Parallel Lint

    Add an option to add PHP Parallel Lint

    Using the option to be e.g. --parallel-lint or simply --lint would add the PHP Parallel Lint package as a development dependency, add related Composer scripts e.g. lint and lint-changes, and add it (i.e. lint-changes) to the Travis CI build configuration.

    What's your opinion on this?

    opened by raphaelstolt 1
Releases(v2.1.0)
Owner
Jonathan Torres
Software Developer.
Jonathan Torres
PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.

P H I N G Thank you for using PHING! PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant. You can do anything wit

The Phing Project 1.1k Dec 22, 2022
A starter-kit for your PHP project.

PHP Noise A starter-kit for your PHP project. It includes frequently needed boilerplate setups (ci, badges, etc.) ?? Installation To install this appl

medunes 52 Dec 17, 2022
GitHub action to setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer...

Setup PHP in GitHub Actions Setup PHP with required extensions, php.ini configuration, code-coverage support and various tools like composer in GitHub

Shivam Mathur 2.4k Jan 6, 2023
remake of doxbin in php

DOXBIN $Version V1.6 $Warnings [ THIS IS NOT THE ORG SRC OF DOXBIN.ORG, PLEASE DON'T FALSE CLAIM AROUND SAYING U HACKED DOXBIN, THE OWNER OF DOXBIN IS

Nano 28 Dec 1, 2021
Phpake is a make-like utility built for PHP.

Phpake is a make-like utility built for PHP. It is pronounced fake because the second p is silent just like the second p in the word elephpant.

Jigar Mehta 8 Jul 26, 2022
Project skeleton generator for Laravel & Lumen projects

Skeletor Skeletor is a PHP based CLI tool that has been built to take away the pain of setting up a base project skeleton for Laravel & Lumen projects

Wouter 39 Oct 4, 2022
Larasymf - mini framework for medium sized projects based on laravel and symfony packages

Larasymf, PHP Framework Larasymf, as its says is a mini framework for medium sized projects based on laravel and symfony packages We have not yet writ

Claude Fassinou 6 Jul 3, 2022
This composer plugin allows you to share your selected packages between your projects by creating symlinks

Composer - Shared Package Plugin This composer plugin allows you to share your selected packages between your projects by creating symlinks. All share

L'Etudiant 169 Sep 20, 2022
A spec compliant, secure by default PHP OAuth 2.0 Server

PHP OAuth 2.0 Server league/oauth2-server is a standards compliant implementation of an OAuth 2.0 authorization server written in PHP which makes work

The League of Extraordinary Packages 6.2k Jan 4, 2023
Standards compliant HTML filter written in PHP

HTML Purifier HTML Purifier is an HTML filtering solution that uses a unique combination of robust whitelists and aggressive parsing to ensure that no

Edward Z. Yang 2.7k Jan 5, 2023
The efficient and elegant, PSR-7 compliant JSON:API 1.1 client library for PHP

Woohoo Labs. Yang Woohoo Labs. Yang is a PHP framework which helps you to communicate with JSON:API servers more easily. Table of Contents Introductio

Woohoo Labs. 160 Oct 16, 2022
📧 Handy email creation and transfer library for PHP with both text and MIME-compliant support.

?? Handy email creation and transfer library for PHP with both text and MIME-compliant support.

Nette Foundation 401 Dec 22, 2022
Simple yet powerful, PSR-compliant, Symfony-driven PHP Blog engine.

brodaty-blog ✒️ Simple Blog Engine based on pure Markdown files. ?? Works without database, caches HTML templates from Markdown files. ?? Fast and ext

Sebastian 3 Nov 15, 2022
This library provides HTML5 element definitions for HTML Purifier, compliant with the WHATWG spec

HTML5 Definitions for HTML Purifier This library provides HTML5 element definitions for HTML Purifier, compliant with the WHATWG spec. It is the most

Mateusz Turcza 92 Nov 16, 2022
This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework

PSR-6 Cache bundle This is a Symfony bundle that lets you you integrate your PSR-6 compliant cache service with the framework. It lets you cache your

null 43 Oct 7, 2021
GDPR compliant TYPO3 content elements which work great with PIWIK Consent Manager.

PIWIK Consent Manager TYPO3 extension PIWIK Consent Manager integration in order to make TYPO3 content elements GDPR compliant. You can click on the i

null 6 Aug 8, 2022
Moodle activity plugin for embedding content from other websites in a GDPR-compliant way

ICON activate external content What is it? This plugin is for when you want to include GDPR-compliant embeddings of content from external platforms su

ICONnewmedia 2 Sep 14, 2022
PSR-18 compliant Circuit Breaker wrapper

Interrupt PSR-18 compliant Circuit Breaker wrapper. Acknowledgement This library is heavily inspired by: ackintosh/ganesha PrestaShop/circuit-breaker

Flávio Heleno 5 Jun 14, 2023
Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless develop

AppzCoder 1.3k Jan 2, 2023