download — disable any output interpolation not to corrupt verbatim content download
The main function of this pragma is to prevent any
interpolation of the output (see the interpolate glossary entry).
It helps to preserve the downloads intact if they
happen to contain constructs similar to
__
or VAR__[tag].
In practice, this pragma is only used internally. If
you wanted to make Interchange a content-delivery engine only, you could
set it in catalog.cfg, and only undefine it for a few
pages where you want standard page processing.
You might take a look at the [deliver] tag which uses this
pragma.
Example: Disable download pragma on a page
Put the following anywhere on your specific page:
[pragma download 0]
Interchange 5.7.0 (5/5 contexts shown):
Source: code/SystemTag/deliver.coretag
Line 82 (context shows lines 72-86)
if($opt->{extra_headers}) {
my @lines = grep /\S/, split /[\r\n]+/, $opt->{extra_headers};
for(@lines) {
my ($header, $val) = split /:/, $_;
$Tag->tag( { op => 'header',
name => $header,
content => $val,
} );
}
}
$::Pragma->{download} = 1;
::response($out);
$Vend::Sent = 1;
return 1;
}
Source: lib/Vend/Interpolate.pm (rev. 2.308 from Mon Sep 22 00:01:19 2008)
Line 539 (context shows lines 529-543 in substitute_image():535)
elsif($joiner =~ m{\\}) {
$joiner = $safe_safe->reval("qq{$joiner}");
}
return length($joiner) ? $joiner : $default;
}
sub substitute_image {
my ($text) = @_;
## Allow no substitution of downloads
return if $::Pragma->{download};
## If post_page routine processor returns true, return. Otherwise,
## continue image rewrite
if($::Pragma->{post_page}) {
Source: lib/Vend/Parse.pm (rev. 2.44 from Thu Dec 20 06:03:07 2007)
Line 771 (context shows lines 761-775 in start():594)
Status: $attr->{status}
Location: $attr->{href}
EOF
#::logDebug("bouncing...status line=\n$Vend::StatusLine");
$$buf = '';
$Initialized->{_buf} = '';
my $body = qq{Redirecting to <a href="%s">%s</a>.};
$body = errmsg($body, $attr->{href}, $attr->{href});
#::logDebug("bouncing...body=$body");
$::Pragma->{download} = 1;
::response($body);
$Vend::Sent = 1;
$self->{SEND} = 1;
return 1;
Source: lib/Vend/Dispatch.pm (rev. 1.103 from Sat Oct 11 00:01:22 2008)
Line 76 (context shows lines 66-80 in response():72)
my $H;
sub http {
return $H;
}
sub response {
my $possible = shift;
return if $Vend::Sent;
if (defined $possible and ! $::Pragma->{download}) {
push @Vend::Output, (ref $possible ? $possible : \$possible);
}
if($::Pragma->{download}) {
Source: lib/Vend/Dispatch.pm (rev. 1.103 from Sat Oct 11 00:01:22 2008)
Line 80 (context shows lines 70-84 in response():72)
}
sub response {
my $possible = shift;
return if $Vend::Sent;
if (defined $possible and ! $::Pragma->{download}) {
push @Vend::Output, (ref $possible ? $possible : \$possible);
}
if($::Pragma->{download}) {
$H->respond(ref $possible ? $possible : \$possible);
}
elsif($Vend::MultiOutput) {
for my $space (keys %Vend::OutPtr) {