summaryrefslogtreecommitdiff
path: root/Xerl/Setup/Parameter.pm
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2018-12-14 17:42:36 +0200
committerPaul Buetow <paul@buetow.org>2018-12-14 17:42:36 +0200
commit6cc1fe15416a6e652b644278626e47658351e545 (patch)
tree4c8890bdd5feef0b806974224181860807e8fd1b /Xerl/Setup/Parameter.pm
parent849560bc3c48f6c753932dd08d2191e36d477ce0 (diff)
parent3e65cce0ec33e290cf45b7cc9e661977bb225810 (diff)
Merge branch 'hosts' of https://github.com/snonux/xerl into hosts
Diffstat (limited to 'Xerl/Setup/Parameter.pm')
-rw-r--r--Xerl/Setup/Parameter.pm50
1 files changed, 50 insertions, 0 deletions
diff --git a/Xerl/Setup/Parameter.pm b/Xerl/Setup/Parameter.pm
new file mode 100644
index 0000000..8d1c019
--- /dev/null
+++ b/Xerl/Setup/Parameter.pm
@@ -0,0 +1,50 @@
+# Xerl (c) 2005-2011, 2013-2015 by Paul Buetow
+#
+# E-Mail: xerl@dev.buetow.org WWW: https://xerl.buetow.org
+#
+# This is free software, you may use it and distribute it under the same
+# terms as Perl itself.
+
+package Xerl::Setup::Parameter;
+
+use strict;
+use warnings;
+
+use v5.14.0;
+
+use Xerl::Base;
+use Xerl::Main::Global;
+use Xerl::Setup::Configure;
+use Xerl::Tools::FileIO;
+
+sub parse {
+ my $self = $_[0];
+ my $config = $self->get_config();
+
+ print "Content-Type: text/plain\n\n"
+ if $config->plain_exists();
+
+ if ( $config->href_exists() ) {
+ print "Location: ", $config->get_href(), "\n\n";
+ $config->set_finish_request(1);
+ }
+ elsif ( $config->env_exists() ) {
+ print "Content-Type: text/plain\n\n";
+ print "$_=", $ENV{$_}, "\n" for keys %ENV;
+ $config->set_finish_request(1);
+ }
+
+ if ( $config->devel_exists() ) {
+ $config->set_nocache(1);
+ }
+
+ if ( $config->conf_exists() ) {
+ print "Content-Type: text/plain\n\n";
+ print "$_=", $config->{$_}, "\n" for keys %$config;
+ $config->set_finish_request(1);
+ }
+
+ return $self;
+}
+
+1;