mtymek / expressive-config-manager

Lightweight library for merging and caching application config
30 stars 4 forks source link

Some questions #18

Closed geerteltink closed 8 years ago

geerteltink commented 8 years ago

You have used ConfigManager::ENABLE_CACHE => true. Is there a reason why the file is not configured like this: ConfigManager::CACHE_FILE => 'data/config-cache.php' ?

Why did you not include zend-stdlib and use ArrayUtils instead: https://github.com/mtymek/expressive-config-manager/blob/master/src/ConfigManager.php#L35-L60

If you want and agree to the changes I can make PR's for it.

mtymek commented 8 years ago

You have used ConfigManager::ENABLE_CACHE => true. Is there a reason why the file is not configured like this: ConfigManager::CACHE_FILE => 'data/config-cache.php' ?

If you had cache file name read from the configuration, then whole caching would be pointless - you would need to do the merging before being able to access cached file. Besides that, having ConfigManager::ENABLE_CACHE as a boolean value allows you to enable cache during deployment process by simply putting a file in your config/autoload directory.

Why did you not include zend-stdlib and use ArrayUtils instead: https://github.com/mtymek/expressive-config-manager/blob/master/src/ConfigManager.php#L35-L60

I was using zend-stdlib it initially, but at some point (inspired by this and a few other topics) I decided to decouple this library from that dependency.

geerteltink commented 8 years ago

If you had cache file name read from the configuration, then whole caching would be pointless - you would need to do the merging before being able to access cached file...

I'm not sure what I was thinking when I wrote that question. Obviously I didn't think it through :D

I was using zend-stdlib it initially, but at some point (inspired by this and a few other topics) I decided to decouple this library from that dependency.

Makes sense.

Thanx for the reply.

mtymek commented 8 years ago

Haha no worries, I it is not the first time somebody asks this question :D Initially I also felt into the same trap and actually started coding it...

geerteltink commented 8 years ago

Uhm, since I already coded it myself in the expressive skeleton I think I should be worried :(