8 use OpenSRF::Utils::SettingsClient;
9 use OpenSRF::Utils::Config;
10 use OpenSRF::Utils::SettingsParser;
12 # TODO: GetOpts to set these
13 my $config_file = '/openils/conf/opensrf_core.xml';
19 usage: $0 xpath/traversing/string
21 Reads $config_file and dumps the structure found at the element
22 located by the xpath argument. Without argument, dumps whole <config>.
24 example: $0 apps/open-ils.search/app_settings
29 @_ and print "ERROR: @_\n";
34 my $load = OpenSRF::Utils::Config->load(
35 config_file => $config_file
37 my $booty = $load->bootstrap();
39 my $conf = OpenSRF::Utils::Config->current;
40 my $cfile = $conf->bootstrap->settings_config;
41 my $parser = OpenSRF::Utils::SettingsParser->new();
42 $parser->initialize( $cfile );
43 $OpenSRF::Utils::SettingsClient::host_config = $parser->get_server_config($conf->env->hostname);
45 my $settings = OpenSRF::Utils::SettingsClient->new();
46 # scalar(@ARGV) or die_usage("Argument is required");
47 my @terms = scalar(@ARGV) ? split('/', shift) : ();
48 $verbose and print "Looking under: ", join(', ', map {"<$_>"} @terms), "\n";
50 my $target = $settings->config_value(@terms);
51 print Dumper($target);
53 # my $lines = $target->{callfile_lines};