TagInclude — include (a group of) tags in Interchange
Include a set of tags for compilation and use under the Interchange server.
TagDir
s are scanned for files, then they're assigned to groups
according to TagGroup
directives, and finally they're included
using TagInclude
.
The syntax supports the use of !
to exclude items,
and keyword ALL
. Tag group names should be prefixed
with :
. See the section called “EXAMPLES”.
Example: Defining TagInclude
The following would include all tags, except those in group
crufty
and tag [get-url]
specifically.
TagInclude ALL !:crufty !get_url
Interchange 5.9.0:
Source: lib/Vend/Config.pm
Line 2626 (context shows lines 2626-2684)
sub parse_tag_include { my ($var, $setting) = @_; my $c; my $g; my $mapper = $incmap{$var} || 'TagGroup'; if(defined $C) { $c = $C->{$var} || {}; $g = $C->{$mapper} || {}; } else { no strict 'refs'; $c = ${"Global::$var"} || {}; $g = ${"Global::$mapper"} || {}; } $setting =~ s/"/ /g; $setting =~ s/^\s+//; $setting =~ s/\s+$//; $setting =~ s/[,\s]+/ /g; if($setting eq 'ALL') { return { ALL => 1 }; } delete $c->{ALL}; get_system_groups() unless $SystemGroupsDone; my @incs = Text::ParseWords::shellwords($setting); for(@incs) { my @things; my $not = 0; if(/:/) { $not = 1 if s/^!//; if(! $g->{$_}) { config_warn( "unknown %s %s included from %s", $mapper, $_, $var, ); } else { @things = @{$g->{$_}} } } else { @things = ($_); } for(@things) { my $not = s/^!// ? ! $not : $not; $c->{$_} = not $not; } } return $c; }