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.9.0 (5/5 contexts shown):
Source: code/SystemTag/deliver.coretag
Line 95 (context shows lines 85-99)
if($opt->{get_encrypted}) { $opt->{get_encrypted} = 1 unless $opt->{get_encrypted} =~ /^\d+$/; my $idx = $opt->{get_encrypted}; while ($idx--) { $$out =~ s/.*?(---+BEGIN PGP MESSAGE--+)/$1/s; } $$out =~ s/(---+END PGP MESSAGE---+).*/$1\n/s; } $::Pragma->{download} = 1; ::response($out); $Vend::Sent = 1; return 1; }
Source: lib/Vend/Interpolate.pm
Line 534 (context shows lines 524-538 in substitute_image():530)
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
Line 772 (context shows lines 762-776 in start():592)
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->{ABORT} = 1; $self->{SEND} = 1;
Source: lib/Vend/Dispatch.pm
Line 74 (context shows lines 64-78 in response():70)
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
Line 78 (context shows lines 68-82 in response():70)
} 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) {