PHPackages                             punkstar/mageconfigsync - 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. punkstar/mageconfigsync

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

punkstar/mageconfigsync
=======================

A utility to aid the storing of Magento configuration in version control.

0.4.0(10y ago)1358.6k30[5 issues](https://github.com/punkstar/mageconfigsync/issues)MITPHPPHP &gt;=5.3.0

Since Sep 12Pushed 6y ago16 watchersCompare

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

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Magento Configuration Sync
==========================

[](#magento-configuration-sync)

This is a tool designed to allow teams to keep Magento (1.x and 2.x supported) configuration under version control, eliminating the unknown when tracking down potentially configuration related bugs.

[![image](https://camo.githubusercontent.com/9eee09f543b7793e39a53cae894f686a9ca65f1fd3a5c207c3ff56ff2f387317/687474703a2f2f75702e6e69636b736179732e636f2e756b2f696d6167652f334a336e34363155314533352f53637265656e25323053686f74253230323031332d30392d3131253230617425323031382e34372e31302e706e67)](https://camo.githubusercontent.com/9eee09f543b7793e39a53cae894f686a9ca65f1fd3a5c207c3ff56ff2f387317/687474703a2f2f75702e6e69636b736179732e636f2e756b2f696d6167652f334a336e34363155314533352f53637265656e25323053686f74253230323031332d30392d3131253230617425323031382e34372e31302e706e67)

File Syntax
-----------

[](#file-syntax)

The configuration values are stored in a YAML file. The format of the file is as follows:

```
environment:
    scope_key:
       path: value

```

For example:

```
production:
    default:
        dev/debug/template_hints: 0
development:
    default:
        dev/debug/template_hints: 1
    stores-1:
        currency/options/base: GBP
        dev/restrict/allow_ips: null

```

The above will:

- disable template hints on product;
- enable template hints on the development environment;
- set the currency to Pounds Sterling in the store scope for the store with ID #1;
- ensure the allowed development ip's are inherited from the website for store #1.

Valid scope keys are:

- default
- stores-`$id`
- websites-`$id`

Usage
-----

[](#usage)

```
php bin/mageconfigsync --help

```

Most commands take an optional argument of `--magento-root` if not running from within a Magento directory and an optional argyment of `--env` used to describe the current environment of the configuration.

### Dump

[](#dump)

```
php bin/mageconfigsync dump --help

```

The dump command outputs the current contents of the configuration as YAML to stdout. Specify `--env` and the environment will be added as the first key, for convenience.

### Load

[](#load)

```
php bin/mageconfigsync load --help

```

The load command synchronises the database with the contents of the file. Any changed lines will be output to stderr. The `--env` option will determine which section of the YAML file is loaded.

### Diff

[](#diff)

```
php bin/mageconfigsync diff --help configuration_file.yaml

```

Example Scenario
----------------

[](#example-scenario)

Thanks to the symfony/yaml component we can use all the tricks YAML provides us, including merge keys. Consider the following file, `config.yml`:

```
prod:
  default: &prod_global
    currency/options/base: GBP
    dev/debug/template_hints: 0

dev:
  default:
