1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: version.coretag,v 1.15 2007-08-05 08:01:03 kwalsh Exp $
10 UserTag version Order extended
11 UserTag version attrAlias module_test modtest
12 UserTag version attrAlias moduletest modtest
13 UserTag version attrAlias require modtest
14 UserTag version addAttr
15 UserTag version Version $Revision: 1.15 $
16 UserTag version Routine <<EOR
18 return $::VERSION unless shift;
20 my $joiner = $opt->{joiner} || "<br$Vend::Xtrailer>";
24 if($opt->{global_error}) {
25 push @out, $Global::ErrorFile;
29 if($opt->{local_error}) {
30 my $dfn = my $fn = $Vend::Cfg->{ErrorFile};
31 my $pre = $Global::Catalog{$Vend::Cat}->{dir} . '/';
33 my $href = $Tag->area("$::Variable->{UI_BASE}/do_view", $fn);
34 push(@out, qq{<a href="$href">$dfn</a>});
40 ref $Global::Environment eq 'ARRAY' ?
41 join ' ', @{$Global::Environment} :
47 push @out, join " ", @{$Global::SafeUntrap};
51 if($opt->{child_pid}) {
57 eval "require $opt->{modtest}";
68 push @out, ::readfile($Global::PIDfile);
73 push @out, Vend::Server::server_start_message('%s', 1);
78 push @out, scalar getpwuid($>) . " (uid $>)";
82 if($opt->{global_locale_options}) {
84 my $curr = $Global::Locale;
86 while ( my($k,$v) = each %$Global::Locale_repository ) {
87 next unless $k =~ /_/;
88 push @loc, "$v->{MV_LANG_NAME}~:~$k=$v->{MV_LANG_NAME}";
91 push @out, join ",", map { s/.*~:~//; $_ } sort @loc;
97 push @out, ($^V ? sprintf("%vd", $^V) : $]) . errmsg(" (called with: %s)", $^X);
101 if($opt->{perl_config}) {
103 push @out, "<pre>\n" . Config::myconfig() . "</pre>";
107 if($opt->{hostname}) {
108 require Sys::Hostname;
109 push @out, Sys::Hostname::hostname()
110 || errmsg("unable to determine hostname");
114 if(not $opt->{db} || $opt->{modules} || $done_something) {
116 push @out, "Interchange Version $::VERSION";
122 push @out, errmsg('%s available (v%s)', 'GDBM', $GDBM_File::VERSION);
125 push @out, errmsg('No %s.', 'GDBM');
127 if($Global::DB_File) {
128 push @out, errmsg('%s available (v%s)', 'Berkeley DB_File', $DB_File::VERSION);
131 push @out, errmsg('No %s.', 'Berkeley DB_File');
134 push @out, errmsg('%s available (v%s)', 'LDAP', $Net::LDAP::VERSION);
136 if($Global::DBI and $DBI::VERSION) {
137 push @out, errmsg ('DBI enabled (v%s), available drivers:', $DBI::VERSION);
138 my $avail = join $joiner, DBI->available_drivers;
139 push @out, "<blockquote>$avail</blockquote>";
143 if($opt->{modules}) {
158 Spreadsheet::ParseExcel
159 Spreadsheet::WriteExcel
168 'Archive::Tar' => q{Only needed for supplementary UserTag definitions.},
169 'Archive::Zip' => q{Only needed for supplementary UserTag definitions.},
170 'Bundle::LWP' => q{Certain parts of these modules (URI::URL and MIME::Base64) are required for Interchange's internal HTTP server. Also, Business::UPS, for calculating shipping, requires this.},
171 'Business::UPS' => q{Enables lookup of shipping costs directly from www.ups.com. Requires Bundle::LWP.},
172 'Compress::Zlib' => q{Only needed for supplementary UserTag definitions.},
173 'Crypt::SSLeay' => q{Payment interface links via HTTPS/SSL.},
174 'DBI' => q{Most people want to use SQL with Interchange, and this is a requirement. You will also need the appropriate DBD module, i.e. DBD::mysql to support MySQL.},
175 'Digest::MD5' => q{IMPORTANT: cache keys and other search-related functions will not work.},
176 'Image::Size' => q{Optional but recommended for [image ...] tag.},
177 'LWP::Simple' => q{External UPS lookup and other internet-related functions will not work.},
178 'MIME::Base64' => q{Provides HTTP services for internal HTTP server and basic authentication.},
179 'Safe::Hole' => q{IMPORTANT: SQL and some tags will not work in embedded Perl.},
180 'Set::Crontab' => q{Used by HouseKeepingCron task scheduler.},
181 'Spreadsheet::ParseExcel' => q{Allows upload of XLS spreadsheets for database import in the UI.},
182 'Spreadsheet::WriteExcel' => q{Allows output of XLS spreadsheets for database export in the UI.},
183 'Storable' => q{Session and search storage will be slower.},
184 'Tie::ShadowHash' => q{Needed for PreFork mode of Interchange, prevents permanent write of configuration.},
185 'Tie::Watch' => q{Minor: cannot set watch points in catalog.cfg.},
186 'URI::URL' => q{Provides HTTP primitives for internal HTTP server.},
188 foreach my $name (@wanted) {
190 eval "require $name";
192 my $info = errmsg($info{$name} || "May affect program operation.");
193 push @out, "$name " . errmsg('not found') . ". $info"
195 elsif($l_than{$name}) {
196 my $ver = ${"${name}::VERSION"};
197 $ver =~ s/^(\d+\.\d+)\..*/$1/;
198 if($ver > $l_than{$name}) {
199 my $info = errmsg($info{$name} || "May affect program operation.");
201 '%s too high a version, need %s or lower',
205 push @out, "$name $ex. $info";
208 elsif($g_than{$name}) {
209 my $ver = ${"${name}::VERSION"};
210 $ver =~ s/^(\d+\.\d+)\..*/$1/;
211 if($ver < $g_than{$name}) {
212 my $info = errmsg($info{$name} || "May affect program operation.");
214 '%s too low a version, need %s or higher',
218 push @out, "$name $ex. $info";
222 my $ver = ${"$name" . "::VERSION"};
223 $ver = $ver ? "v$ver" : 'no version info';
224 push @out, "$name " . errmsg('found') . " ($ver).";
229 return join $joiner, @out;