| Previous · Next | |
| User | Message |
|
arjan
|
Date: 1/31/2010 11:35 am · Subject: wgdev config: how to set override · Rating: -1
Hi,I've found out that one has to name the main and subcommand first when specifying configuration options for wgdev. This command: wgd config --struct command.reset.config.copy '["macros","sslEnabled"]' leads to this WGDev-config file: { "command" : { "reset" : { "config" : { "copy" : [ "macros", "sslEnabled" ] }, }, "webgui_config" : "dev.localhost.localdomain.conf", "webgui_root" : "/data/WebGUI" } } And this makes that if you reset the WebGUI-config of your site, the macros and sslEnabled option will be preserved. This works like a breeze. Now, in the same way this command: wgd config --struct command.reset.config.override '{"emailOverride" : "foo@bar.org"} results in this WGDev config file: { "command" : { "reset" : { "config" : { "override" : { "emailOverride" : "foo@bar.org" } } }, "webgui_config" : "dev.localhost.localdomain.conf", "webgui_root" : "/data/WebGUI" } } I expect this to always add the emailOverride configutation option to my WebGUI-config when I use "wgd reset --config". However this does not work. I found out the problem arises in line 383 of Reset.pm > my $reset_config = $wgd->my_config('config'); This $reset_config variable remains empty. I don't understand the sub my_config completely. Should I specify command.reset.config.override differently? Kind regards, Arjan. |
| Back to Top |
Rate [ | ]
|
|
Graham
|
Date: 1/31/2010 11:55 am · Subject: Re: wgdev config: how to set override · Rating: -1
I'm not able to reproduce this problem locally. What version of WGDev are you using?There isn't anything wrong with how you are setting the config options, although the command wgd config command.reset.config.override.emailOverride 'foo@bar.org' would be simpler and do pretty much the same thing. Regarding the my_config method, it returns the config section for the module that is calling it. So in the module WGDev::Command::Reset, that is translated to command.reset. With a parameter, it returns that sub-section, so $wgd->my_config('config') would be command.reset.config. On Jan 31, 2010, at 11:35 AM, <dev@webgui.org> <dev@webgui.org> wrote: arjan wrote: |
| Back to Top |
Rate [ | ]
|
|
arjan
|
Date: 1/31/2010 5:10 pm · Subject: Re: wgdev config: how to set override · Rating: -1
I've found the problem. It works.Thanks for the syntax tip. WGDev is great. graham@plainblack.com wrote: > Graham wrote: > > I'm not able to reproduce this problem locally. What version of WGDev > are you using? > There isn't anything wrong with how you are setting the config > options, although the command > wgd config command.reset.config.override.emailOverride 'foo@bar.org > ' > would be simpler and do pretty much the same thing. > Regarding the my_config method, it returns the config section for the > module that is calling it. So in the module WGDev::Command::Reset, > that is translated to command.reset. With a parameter, it returns > that sub-section, so $wgd->my_config('config') would be > command.reset.config. > > On Jan 31, 2010, at 11:35 AM, > > wrote: > > arjan wrote: > > Hi, > > I've found out that one has to name the main and subcommand first > when > specifying configuration options for wgdev. This command: > > wgd config --struct command.reset.config.copy > '["macros","sslEnabled"]' > > leads to this WGDev-config file: > > { > "command" : { > "reset" : { > "config" : { > "copy" : [ > "macros", > "sslEnabled" > ] > }, > }, > "webgui_config" : "dev.localhost.localdomain.conf", > "webgui_root" : "/data/WebGUI" > } > } > > And this makes that if you reset the WebGUI-config of your site, the > macros and sslEnabled option will be preserved. > > This works like a breeze. > > Now, in the same way this command: > wgd config --struct command.reset.config.override '{"emailOverride" : > "foo@bar.org "} > > results in this WGDev config file: > > { > "command" : { > "reset" : { > "config" : { > "override" : { > "emailOverride" : "foo@bar.org > " > } > } > }, > "webgui_config" : "dev.localhost.localdomain.conf", > "webgui_root" : "/data/WebGUI" > } > } > > I expect this to always add the emailOverride configutation option > to my > WebGUI-config when I use "wgd reset --config". > > However this does not work. I found out the problem arises in line > 383 > of Reset.pm > > my $reset_config = $wgd->my_config('config'); > This $reset_config variable remains empty. I don't understand the sub > my_config completely. > > Should I specify command.reset.config.override differently? > > Kind regards, > Arjan. > > > http://www.webgui.org/forums/dev/wgdev-config-how-to-set-override > > -- > > WebGUI > http://www.webgui.org > > > > > http://www.webgui.org/forums/dev/wgdev-config-how-to-set-override/1 > ------------------------------------------------------------------------ > > > > |
| Back to Top |
Rate [ | ]
|