CIPP

 view release on metacpan or  search on metacpan

doc/html2ps  view on Meta::CPAN

}
sub gu {
  if($package{'libwww-perl'}) {
    require LWP::UserAgent;
    $ua=new LWP::UserAgent;
    $req = HTTP::Request->new(GET => $url);
    $req->authorization_basic(@_) if(@_);
    $ua->agent($spoof) if($spoof);
    my $res = $ua->request($req);
    $code=$res->code;
    $contyp=$res->header('content-type');
    $cont=$res->content;
  } else {
    require "www.pl";
    @opts=@_?("authorization=$_[0]:$_[1]"):();
    push(@opts,"quiet") if(!$opt_d);
    $www::useragent=$spoof if($spoof);
    ($status,$memo,%info)=&www::open_http_url(*FILE,$url,@opts);
    $code=$info{'CODE'};
    ($contyp)=$info{'HEADER'}=~/Content-type:\s+(.*)/i;
    $cont=<FILE>;

lib/CIPP/Runtime/NewSpirit.pm  view on Meta::CPAN


	my $mime_type = $self->get_mime_type;
	
	if ( $mime_type =~ m!text/html!i &&
	     $mime_type !~ /charset=/i   &&
	     $self->get_utf8 ) {
		$mime_type = "text/html; charset=utf-8";
	}

	if ( $mime_type ne 'cipp/dynamic' ) {
		$self->get_http_header->{'content-type'} = $mime_type;
		$self->SUPER::print_http_header(@_);
	}

	1;
}	

sub get_db_config {
	my $self = shift;
	my %par = @_;
	my ($db) = @par{'db'};

lib/CIPP/Runtime/Request.pm  view on Meta::CPAN

			 qq[">$font<b>Include Backtrace</b></font></td>].
			 $backtrace_html;
	}

	$html .= "</table>\n";

	# Print error message to browser, if we allowed to do so
	if ( $self->get_show_error and exists $ENV{QUERY_STRING} ) {
		# print a HTTP header, if not yet printed
		if ( not $self->get_http_header_printed ) {
			print "content-type: text/html\n\n";
		}

		# open scripts or tables may confuse some browser,
		# but we *want* our message to appear!
		print "</textarea></script></table></table></table></table>".
		      "</table></table></table></table>\n";

	
		# print HTML error message
		print $html;

lib/CIPP/Runtime/Request.pm  view on Meta::CPAN

	
	1;
}

sub init_error {
	my $self = shift;
	my %par = @_;
	my ($message) = @par{'message'};
	
	if ( not $self->get_http_header_printed ) {
		print "content-type: text/html\n\n";
	}

	print "Initialization Error\n";
	
	$self->exit;

	1;
}

sub exit {

lib/CIPP/Runtime/Request.pm  view on Meta::CPAN

		input  => {},
		output => {},
	) if $custom_http_header_file;

	# print HTTP Header
	my ($k, $v);
	my $content_type;
	while ( ($k, $v) = each %{$self->get_http_header} ) {
#		$k =~ s/\b([a-z])/uc($1)/eg;
		print "$k: $v\n";
		$content_type = $v if $k =~ /^content-type$/i;
	}
	
	print "\n";
	
	$self->set_http_header_printed (1);

	if ( $content_type =~ m!text/html! && !$self->get_xhtml ) {
		my $runtime  = $self->get_project_handle->get_cipp_runtime_version;
		my $compiler = $self->get_project_handle->get_cipp_compiler_version;
		print "<!-- CIPP $compiler / $CIPP::Runtime::Request::VERSION | $runtime - Copyright (c) dimedis GmbH, All Rights Reserved -->\n\n";



( run in 1.785 second using v1.01-cache-2.11-cpan-524268b4103 )