Name

download — disable any output interpolation not to corrupt verbatim content download

VALUE

0 | 1

DEFAULT

0

DESCRIPTION

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 __VAR__ or [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.

EXAMPLES

Example: Disable download pragma on a page

Put the following anywhere on your specific page:

[pragma download 0]

NOTES

AVAILABILITY

download is available in Interchange versions:

4.6.0-5.7.0 (git-head)

SOURCE

Interchange 5.7.0 (5/5 contexts shown):

Source: code/SystemTag/deliver.coretag
Line 96 (context shows lines 86-100)

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
Line 536 (context shows lines 526-540 in substitute_image():532)

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 774 (context shows lines 764-778 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
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) {

AUTHORS

Interchange Development Group

SEE ALSO

deliver(7ic)

DocBook! Interchange!