Going further with configuration in project

54 views
Skip to first unread message

Grummfy

unread,
Nov 27, 2014, 5:55:12 AM11/27/14
to aur...@googlegroups.com
Hi,
If you looked at some of the last topics you will see that the configuration (in project) needs some improvements.

I see two steps :
  1. make environment extending other
  2. add value configuration

1. Environment override

Now what we have is Commn is overrided by Dev or Test or Prod and that's all. I think it could be very usefull to have the possibilities, for Prod to take the same as dev, but just add some stuff and not copying it.

So we could have something like this : Prod override Stage override Dev. We can imagine adding steps if we want like now we add new environment.

For now, the only way to do it, as I see, is to load the smallest steps (for now common) and afer loading the next higher step. But we can probably improve this with some caching system (later).

2. Adding value configuration

Now, what I see in project is moreover a configuration of dependency injection. But it should also be possible to have a configuration of value like :
  • mail provider (from dev or prod it change)
  • db login/password/host
  • specific path
  • ...

A mail or a a db, will be, most of the time initialized with the same way in each environment, but the value used to do it will change. So we can inject the login/password/.. in another way than what it should be but with a configuration depending of the environment.

Some config libraries :

So, there is a lot of solution but, when it will be there, it should be available through the dependency injection configuration.

So what did you think about it?


Hari K T

unread,
Nov 27, 2014, 7:36:19 AM11/27/14
to aur...@googlegroups.com
Hi, 

If you looked at some of the last topics you will see that the configuration (in project) needs some improvements.

I see two steps :
  1. make environment extending other
  2. add value configuration

1. Environment override

Now what we have is Commn is overrided by Dev or Test or Prod and that's all. I think it could be very usefull to have the possibilities, for Prod to take the same as dev, but just add some stuff and not copying it.

So we could have something like this : Prod override Stage override Dev. We can imagine adding steps if we want like now we add new environment.

I like your idea. But I wonder whether we really need anything specific there ? 

Eg : When it comes to db, if there is some sort of configuration values can be loaded as you mentioned below it will be nice. 

For now, the only way to do it, as I see, is to load the smallest steps (for now common) and afer loading the next higher step. But we can probably improve this with some caching system (later).

2. Adding value configuration

Now, what I see in project is moreover a configuration of dependency injection. But it should also be possible to have a configuration of value like :
  • mail provider (from dev or prod it change)
  • db login/password/host
  • specific path
  • ...

A mail or a a db, will be, most of the time initialized with the same way in each environment, but the value used to do it will change. So we can inject the login/password/.. in another way than what it should be but with a configuration depending of the environment.

Some config libraries :

Yes I was talking with Paul on the other day and someone (mbredav I guess ) pointed me to https://github.com/josegonzalez/php-dotenv .

So, there is a lot of solution but, when it will be there, it should be available through the dependency injection configuration.

So what did you think about it?

Thank you for the feedback. I hear you and agree with you.

As a micro framework Aura.Web_Project is nice, but there are somethings that need to be documented as a full stack framework. I am not blaming anyone, but time and interest differs day by day.

Thank you
 
Hari K T

You can ring me : +91 9388 75 8821

Skype  : kthari85
Twitter : harikt

Grummfy

unread,
Nov 27, 2014, 7:48:32 AM11/27/14
to aur...@googlegroups.com
Hello,

2014-11-27 13:36 GMT+01:00 Hari K T <ktha...@gmail.com>:
Hi, 

If you looked at some of the last topics you will see that the configuration (in project) needs some improvements.

I see two steps :
  1. make environment extending other
  2. add value configuration

1. Environment override

Now what we have is Commn is overrided by Dev or Test or Prod and that's all. I think it could be very usefull to have the possibilities, for Prod to take the same as dev, but just add some stuff and not copying it.

So we could have something like this : Prod override Stage override Dev. We can imagine adding steps if we want like now we add new environment.

I like your idea. But I wonder whether we really need anything specific there ? 

Eg : When it comes to db, if there is some sort of configuration values can be loaded as you mentioned below it will be nice. 
Yes database, but there is not only database.
Example from a real application (not an auraphp one ;() where we use flysystem. In dev and test : local filesystem are used, in stage and prod it's amazon s3. There is some configuration line to do it.
Same for error reporting, in de and, test => log only, in stage some are by mail and in production some level are by mail, some other with slack or sms

For now, the only way to do it, as I see, is to load the smallest steps (for now common) and afer loading the next higher step. But we can probably improve this with some caching system (later).

2. Adding value configuration

Now, what I see in project is moreover a configuration of dependency injection. But it should also be possible to have a configuration of value like :
  • mail provider (from dev or prod it change)
  • db login/password/host
  • specific path
  • ...

A mail or a a db, will be, most of the time initialized with the same way in each environment, but the value used to do it will change. So we can inject the login/password/.. in another way than what it should be but with a configuration depending of the environment.

Some config libraries :

Yes I was talking with Paul on the other day and someone (mbredav I guess ) pointed me to https://github.com/josegonzalez/php-dotenv .

So, there is a lot of solution but, when it will be there, it should be available through the dependency injection configuration.

So what did you think about it?

Thank you for the feedback. I hear you and agree with you.

As a micro framework Aura.Web_Project is nice, but there are somethings that need to be documented as a full stack framework. I am not blaming anyone, but time and interest differs day by day.

Thank you
 



 
In my case, it's overall the Cli_Project ;).
I agree we need more documentation, but with the exissting one, there are already a lot and it's very usefull.

Moshe Brevda

unread,
Nov 29, 2014, 1:49:22 PM11/29/14
to aur...@googlegroups.com
Was talking to Paul about this one day and pointed out that environmental variables are just that - variables that depend on the code's specific environment. He seemed to agree that the current implementation was just to solve a particular itch/habit and not necessarily the best practice going forward.

Settings/variables that change based on context should definitely not be checked in to a SCCS. Until Aura has one of their own, josegonzalez/php-dotenv seems to be a great .env parser which helps solve the situations where you can't actually set environmental variables. Just don't forget to add it to your .gitignore!



Reply all
Reply to author
Forward
0 new messages