Troubles with FileConfig in package context
Permalink
I'm using Package::getFileConfig(), I prefer to have my configuration in files for version control and deployment. So, I'm doing $config->get, $config->set and $config->has.
The data seems to be saved under /application/config/generated_overrides/packagename/. Is this correct ?
Now, I destroyed packagename folder by mistake and restored it from Time Machine. And it seems I have somehow broken something. save() seems to work, but get always returns null. I tried deleting the packagename folder to see if it would be recreated, but save appears to do nothing.
I checked the access rights and they seem normal (755). Is there any way to force this folder to be regenerated ?
The data seems to be saved under /application/config/generated_overrides/packagename/. Is this correct ?
Now, I destroyed packagename folder by mistake and restored it from Time Machine. And it seems I have somehow broken something. save() seems to work, but get always returns null. I tried deleting the packagename folder to see if it would be recreated, but save appears to do nothing.
I checked the access rights and they seem normal (755). Is there any way to force this folder to be regenerated ?
If you want to save config information to a file instead of the database, you can try this:
1. Under your namespace, import the Config class.
use Config;
2. With the Config class imported, you can use save(), set(), and get().
3. All three methods use the namespace.group.key or namespace.key syntax for accessing the config values. These will be used to create an array.
- namespace will be the name of the .php config file created
- group will be the parent of child keys
- key will be the array key for a value
Example: namespace.group.key
- this creates a my_package_config.php file in application\config\generated_overrides
application\config\generated_overrides\my_package_config.php
- this would be the contents of my_package_config.php
Example: namespace.key
- this creates a my_package_config.php file in application\config\generated_overrides
application\config\generated_overrides\my_package_config.php
- this would be the contents of my_package_config.php