PHPackages                             praxigento/composer\_plugin\_templates - 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. praxigento/composer\_plugin\_templates

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

praxigento/composer\_plugin\_templates
======================================

Composer plugin to create locally specific configuration from set of template files and from file with configuration parameters.

1.0.8(9y ago)03.0k1MITPHPPHP &gt;=5.3.0

Since Jan 13Pushed 9y ago2 watchersCompare

[ Source](https://github.com/praxigento/composer_plugin_templates)[ Packagist](https://packagist.org/packages/praxigento/composer_plugin_templates)[ Docs](https://github.com/praxigento/composer_plugin_templates)[ RSS](/packages/praxigento-composer-plugin-templates/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

Praxigento plugin for PHP Composer to generate local configs from templates
===========================================================================

[](#praxigento-plugin-for-php-composer-to-generate-local-configs-from-templates)

[![Build Status](https://camo.githubusercontent.com/4568ad7b4e18198151b4d09b3a8c5003afdaa038d2a665c27605e8dd3cbd900e/68747470733a2f2f7472617669732d63692e6f72672f707261786967656e746f2f636f6d706f7365725f706c7567696e5f74656d706c617465732e737667)](https://travis-ci.org/praxigento/composer_plugin_templates/)

What is this?
-------------

[](#what-is-this)

Plugin for PHP Composer to create locally specific configuration from set of template files and files with configuration parameters. Templates processing is occurred before any composer command (excluding 'install' cause plugin is not installed before command have been executed).

[![screenshot](img/screenshot.png)](img/screenshot.png)

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

[](#installation)

Add to your project's *composer.json*:

```
{
  "require": {
    "praxigento/composer_plugin_templates": "*"
  }
}

```

Usage
-----

[](#usage)

### Setup configuration file

[](#setup-configuration-file)

Create plugin's configuration file ( *./templates.json*, for example) and setup **extra.praxigento\_templates\_config**parameter in your project's *composer.json*::

```
{
  "extra": {
    "praxigento_templates_config": "./templates.json"
  }
}

```

Plugin can use more than one configuration file, data from all files will be merged into one config structure:

```
{
  "extra": {
    "praxigento_templates_config": ["./under_vc.json", "./not_under_vc.json"]
  }
}

```

This can be useful in case when set of templates is the same for all instances (this part of configuration can be under version control) and variables (all or part of them) are unique for each instance.

### Configuration file structure

[](#configuration-file-structure)

`./templates.json`:

```
{
  "vars": {
    "MYSQL_HOST": "localhost",
    "MYSQL_USER": "magento_github_user",
    "MYSQL_PASSWORD": "s8pTo3X5QCsr4SkY48zF",
    "MYSQL_DBNAME": "magento_github_db"
  },
  "templates": {
    "local.xml": {
      "src": "test/tmpl/local.xml",
      "dst": "test/mage/app/etc/local.xml",
      "rewrite": true
    },
    "dump.sh": {
      "src": "test/tmpl/dump.sh",
      "dst": "test/bin/dump_db/dump.sh",
      "rewrite": true
    }
  }
}

```

#### vars

[](#vars)

Set of the template's placeholders `${MYSQL_HOST}` and values `localhost` to be inserted into templates:

```
{
  "vars": {
    "MYSQL_HOST": "localhost",
    "MYSQL_USER": "magento_github_user",
    "MYSQL_PASSWORD": "s8pTo3X5QCsr4SkY48zF",
    "MYSQL_DBNAME": "magento_github_db"
  }
}

```

#### templates

[](#templates)

Set of the templates to be processed on every composer command (install, update, status, ...):

```
{
  "templates": {
    "local.xml": {
      "src": "test/tmpl/local.xml",
      "dst": "test/mage/app/etc/local.xml",
      "rewrite": true
    },
    "dump.sh": {
      "src": "test/tmpl/dump.sh",
      "dst": "test/bin/dump_db/dump.sh",
      "rewrite": true,
      "condition": {
        "var": "MYSQL_HOST",
        "operation": "!=",
        "value": "localhost"
      }
    }
  }
}

```

Labels (`local.xml` &amp; `dump.sh`) are for reference only.

- *src*: *(required)* path to template file;
- *dst*: *(required)* path to result file (where placeholders are replaced by its values);
- *rewrite*: 'true' to rewrite destination file if exists ('false' by default);
- *condition*: simple condition to process this template file;
    - *var*: name of the variable for left part of the condition;
    - *operation*: one of the two operations ('=' or '!=');
    - *value*: string value for compare (right part of the operation);

License
-------

[](#license)

All contents of this package are licensed under the [MIT license](LICENSE).

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97.5% 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 ~120 days

Recently: every ~132 days

Total

6

Last Release

3531d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/777e6cb17a881eccaf4709fe906f8835eae38a38cd01a93cdee5ca8e172e61fe?d=identicon)[praxigento](/maintainers/praxigento)

---

Top Contributors

[![flancer64](https://avatars.githubusercontent.com/u/5052385?v=4)](https://github.com/flancer64 "flancer64 (39 commits)")[![viktor-gusev](https://avatars.githubusercontent.com/u/6107950?v=4)](https://github.com/viktor-gusev "viktor-gusev (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/praxigento-composer-plugin-templates/health.svg)

```
[![Health](https://phpackages.com/badges/praxigento-composer-plugin-templates/health.svg)](https://phpackages.com/packages/praxigento-composer-plugin-templates)
```

###  Alternatives

[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M14](/packages/vaimo-composer-patches)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5341.9M440](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2122.6M172](/packages/drupal-core-project-message)[olvlvl/composer-attribute-collector

A convenient and near zero-cost way to retrieve targets of PHP 8 attributes

184108.8k8](/packages/olvlvl-composer-attribute-collector)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41716.4k2](/packages/lullabot-drainpipe)

PHPackages © 2026

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