2017 © Pedro Peláez
 

magento-module magento-env-config

Use environment variables in Magento 1 local.xml, uses getenv to get the values

image

gracious/magento-env-config

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  • Wednesday, May 16, 2018
  • by pepijnblom
  • Repository
  • 2 Watchers
  • 1 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Ability to use envvars in Magento config

Original module: https://github.com/rossigee/magento-config-envvars which used $_SERVER vars which did not work for us using HHVM., (*1)

In our development workflow, our webservers provide environment configuration information to our applications via environment variables (i.e. MAGE_DB_HOST, MAGE_DB_USER etc). This doesn't sit well with Magento's XML based configuration approach., (*2)

This little hack allows us to use '$MAGE_DB_HOST' and any other environment variables in our XML configuration files., (*3)

You can also specify a default value in case the envvar is missing or empty by appending it with double pipe symbols (e.g. '$MAGE_DB_HOST||localhost')., (*4)

Usage

Example part of our local.xml..., (*5)

...
            <default_setup>
                <connection>
                    <host>$MAGE_DB_HOST</host>
                    <username>$MAGE_DB_USER</username>
                    <password>$MAGE_DB_PASS</password>
                    <dbname>$MAGE_DB_NAME</dbname>
                    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
                    <model><![CDATA[mysql4]]></model>
                    <type><![CDATA[pdo_mysql]]></type>
                    <pdoType></pdoType>
                    <active>1</active>
                </connection>

...

The Versions

16/05 2018

dev-master

9999999-dev https://github.com/gracious/magento-config-envvars

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  Sources   Download

MIT

The Requires

 

26/03 2018

1.0.3

1.0.3.0 https://github.com/gracious/magento-config-envvars

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  Sources   Download

MIT

The Requires

 

26/03 2018

1.0.1

1.0.1.0 https://github.com/gracious/magento-config-envvars

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  Sources   Download

MIT

The Requires

 

26/03 2018

1.0.2

1.0.2.0 https://github.com/gracious/magento-config-envvars

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  Sources   Download

MIT

The Requires

 

26/03 2018

1.0.0

1.0.0.0 https://github.com/gracious/magento-config-envvars

Use environment variables in Magento 1 local.xml, uses getenv to get the values

  Sources   Download

MIT

The Requires