diff options
| author | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 22:23:51 +0200 |
|---|---|---|
| committer | Paul Buetow (pluto.buetow.org) <paul@buetow.org> | 2013-09-28 22:23:51 +0200 |
| commit | 29f3abac1a9f545358d620947a19cfd29854ce95 (patch) | |
| tree | 7383c6847f8150257fa8f658ad469a0009eaf5f8 /Xerl/Setup/Parameter.pm | |
| parent | fd7590d71aeee380e7c87ed77de592df1f30f5ef (diff) | |
Move Packages Configure, Parameter and Request from Xerl::Page into Xerl::Setup
Diffstat (limited to 'Xerl/Setup/Parameter.pm')
| -rw-r--r-- | Xerl/Setup/Parameter.pm | 50 |
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..45c860d --- /dev/null +++ b/Xerl/Setup/Parameter.pm @@ -0,0 +1,50 @@ +# Xerl (c) 2005-2011, 2013 Dipl.-Inform. (FH) Paul C. Buetow +# +# E-Mail: xerl@dev.buetow.org WWW: http://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 Xerl::Setup::Parameter $self = $_[0]; + my Xerl::Setup::Configure $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; |
