package Apache::ParseControl; use strict; use Apache::Constants qw(:common); sub handler { my $r = shift; my $debug; $debug = $r->dir_config('debugNoParse') eq 'on' ? 1 : 0; my $flags = 'O_RDONLY'; my $filename = $r->filename; $r->send_http_header; if ($debug == 1){ my $host = $r->get_remote_host; my $ct = $r->content_type; my $uri = $r->uri; my $filetype =""; if (-B $filename) { $filetype = "binary"; } else { $filetype = "text"; } $r->print("$host\n$ct\n$uri\n$filename\n$filetype\n"); } print $r->dir_config('debugNoParse'); sysopen(FH, $filename, $flags); while(){ print; } close(FH); return OK; } 1; __END__ =head1 NAME Apache::ParseControl - an apache module to control the parsing of server-side scripts =head1 SYNOPSIS In a VirtualHost, Location, or Directory directive SetHandler perl-script PerlHandler Apache::ParseControl =head1 ABSTRACT This module operates at the content handling stage of resource retrieval in Apache, returning binary files as binary and text files as text, that is, it will return the source of cgi, php, etc. instead of parsing any server-side scriping. =head1 DESCRIPTION =head1 AUTHOR INFORMATION Copyright 2001, D. Anthony Patrick. All rights reserved. Originally conceived and written for the College and Graduate School of Education at Kent State University. Released with permission of The College and Graduate School of Education, Kent State University. This library is free software; you can distribute it and/or modify it under the same terms as Perl itself. Check http://www.cpan.org and http://home.config.com/~dpatrick/computing/perl/ for new versions and updates. =head1 CREDITS =head1 BUGS =head1 SEE ALSO Stein & MacEachern, Writing Apache Modules with Perl and C, 1999, O'Reilly and Associates, ISBN 1-56592-567-X WebDAV Resources Site - http://www.webdav.org =head1 THANKS To MDK for listening (and not listening) to my endless drone about the wonders of Perl and nature of computing today. =cut