diff options
| author | admin (deltavega) <deltavega@mx.buetow.org> | 2018-12-22 13:37:47 +0100 |
|---|---|---|
| committer | admin (deltavega) <deltavega@mx.buetow.org> | 2018-12-22 13:37:47 +0100 |
| commit | e30f4a9430532f5dbea630a5547ba8b779542ac3 (patch) | |
| tree | 8f70a053e857f7fe7fbd275c3b984f3925f6e27a /Xerl/Page/Document.pm | |
| parent | c32840d97058cf56712042309679c90da2ec1322 (diff) | |
cleanup
Diffstat (limited to 'Xerl/Page/Document.pm')
| -rw-r--r-- | Xerl/Page/Document.pm | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Xerl/Page/Document.pm b/Xerl/Page/Document.pm deleted file mode 100644 index 4ba1c0b..0000000 --- a/Xerl/Page/Document.pm +++ /dev/null @@ -1,55 +0,0 @@ -# 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::Page::Document; - -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(); - - return undef unless $config->document_exists(); - - my $document = $config->get_document(); - my ($filename) = $document =~ m#([^/]+)$#; - my ($postfix) = $document =~ /\.(.+)$/; - my $path; - - print 'Content-Type: '; - print $config->getval( 'ctype.' . lc($postfix) ), "\n"; - print "Content-Disposition: attachment; filename=\"$filename\"\n\n"; - - $path = $config->get_hostpath() . "/htdocs/$document"; - unless ( -f $path ) { - $path = - $config->get_hostroot() - . $config->get_defaulthost() - . "/htdocs/$document"; - } - - my $io = Xerl::Tools::FileIO->new( path => $path ); - - if ( -1 == $io->fslurp() ) { - $config->set_finish_request(1); - } - else { - $io->print(); - } - - return undef; -} - -1; |
