eZ Community » Forums » Developer » Define different configuration for...
expandshrink

Define different configuration for different environnement inside the same file

Define different configuration for different environnement inside the same file

Wednesday 18 January 2012 11:31:36 am - 4 replies

Hi,

The technical team of my customer ask me to change configuration of my eZ Publish project in order to  have one unified configuration file like this : 

[PROD]

[DATABASESETTINGS]

....

[MAILSETTINGS]

....

[PRE-PROD}

[DATABASESETTINGS]

....

[MAILSETTINGS]

....

 

They want this file cause they don't want to change everytime configuration files when they switch project to another environnement.

Then my question is it possible to make a mechanism like this ? Is it possible to overload INI files directly with PHP (inside config.php for example) ?

Thanks a lot

 

 

Wednesday 18 January 2012 1:43:40 pm

Hello Etienne,

Use symlink to easily change your settings.

Wednesday 18 January 2012 2:13:58 pm

Hello Etienne,

 

While in the past a symlink was the best way in the past, today there are much better solutions to consider instead.

 

http://projects.ez.no/noveniniupdate

http://projects.ez.no/mirror_ini

 

I recommend trying to use noveniniupdate instead of a symlink.

 

I hope this helps ...

 

Cheers,

Heath

Wednesday 18 January 2012 8:40:25 pm

Another possibility is to set up one siteaccess for every environment. This way you need to have no deployment script or symlink setup: all siteaccess folders are always available on every environment. Your colleagues need to edit different files, not a single one, but they can use filesystem-comparing tool to make sure all the changes they make to one environment are properly reflected on the others.

Eg: frontend_dev, frontend_test, frontend_prod, backoffice_dev, backoffice_test, backoffice_prod.

All the settings which are common to all environments you move to override or to an extension, to keep duplication minimal.

A nice side effect is that you can define a custom "dev" design to sit on top of the main design for frontend and backoffice dev siteaccesses in which you change background color and favicon. This way you always know which site you connect to and minimize the risk of doing bad changes in production.

The main problem with this is that it only work as far as you have a few siteaccess to start with. If you start out with 10, going to 30 might be seen as crazy by most people...

Modified on Wednesday 18 January 2012 8:42:21 pm by Gaetano Giunta

Thursday 19 January 2012 9:47:35 am

Hi,

Thanks a lot, i will use noveniniupdate, it's exactly what i want.

Cheers,

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from