bug Fixing opac/opac-reserve.pl was broken
[koha.git] / about.pl
1 #!/usr/bin/perl
2  
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
8 # version.
9 #
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA  02111-1307 USA
17
18 use strict;
19
20 use C4::Output;    # contains gettemplate
21 use C4::Auth;
22 use C4::Context;
23 use CGI;
24 use LWP::Simple;
25 use XML::Simple;
26 use Config;
27
28 my $query = new CGI;
29 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30     {
31         template_name   => "about.tmpl",
32         query           => $query,
33         type            => "intranet",
34         authnotrequired => 0,
35         flagsrequired   => { catalogue => 1 },
36         debug           => 1,
37     }
38 );
39
40 my $kohaVersion   = C4::Context::KOHAVERSION;
41 my $osVersion     = `uname -a`;
42 my $perl_path = $^X;
43 if ($^O ne 'VMS') {
44     $perl_path .= $Config{_exe} unless $perl_path =~ m/$Config{_exe}$/i;
45 }
46 my $perlVersion   = $];
47 my $mysqlVersion  = `mysql -V`;
48 my $apacheVersion = `httpd -v`;
49 $apacheVersion = `httpd2 -v` unless $apacheVersion;
50 $apacheVersion = (`/usr/sbin/apache2 -V`)[0] unless $apacheVersion;
51 my $zebraVersion = `zebraidx -V`;
52
53 $template->param(
54     kohaVersion   => $kohaVersion,
55     osVersion     => $osVersion,
56     perlPath      => $perl_path,
57     perlVersion   => $perlVersion,
58     perlIncPath   => [ map { perlinc => $_ }, @INC ],
59     mysqlVersion  => $mysqlVersion,
60     apacheVersion => $apacheVersion,
61     zebraVersion  => $zebraVersion,
62 );
63 my @component_names =
64     qw/
65 Algorithm::CheckDigits
66 Biblio::EndnoteStyle
67 CGI
68 CGI::Carp
69 CGI::Session
70 CGI::Session::Serialize::yaml
71 Class::Factory::Util
72 Class::Accessor
73 Compress::Zlib
74 DBD::mysql
75 DBI
76 Data::Dumper
77 Data::ICal
78 Date::Calc
79 Date::ICal
80 Date::Manip
81 Digest::MD5
82 Email::Date
83 File::Temp
84 GD
85 GD::Barcode::UPCE
86 Getopt::Long
87 Getopt::Std
88 HTML::Template::Pro
89 HTTP::Cookies
90 HTTP::OAI
91 HTTP::Request::Common
92 HTML::Scrubber
93 JSON
94 LWP::Simple
95 LWP::UserAgent
96 Lingua::Stem
97 List::Util
98 List::MoreUtils
99 Locale::Language
100 MARC::Crosswalk::DublinCore
101 MARC::Charset
102 MARC::File::XML
103 MARC::Record
104 MIME::Base64
105 MIME::Lite
106 MIME::QuotedPrint
107 Mail::Sendmail
108 Net::LDAP
109 Net::LDAP::Filter
110 Net::Z3950::ZOOM
111 PDF::API2
112 PDF::API2::Page
113 PDF::API2::Util
114 PDF::Reuse
115 PDF::Reuse::Barcode
116 POE
117 POSIX
118 Schedule::At
119 SMS::Send
120 Term::ANSIColor
121 Test
122 Test::Harness
123 Test::More
124 Text::CSV
125 Text::CSV_XS
126 Text::Iconv
127 Text::Wrap
128 Time::HiRes
129 Time::localtime
130 Unicode::Normalize
131 XML::Dumper
132 XML::LibXML
133 XML::LibXSLT
134 XML::SAX::ParserFactory
135 XML::SAX::Writer
136 XML::Simple
137 XML::RSS
138 YAML::Syck
139       /;
140
141 my @components = ();
142
143 my $counter=0;
144 foreach my $component ( sort @component_names ) {
145     my $version;
146     if ( eval "require $component" ) {
147         $version = $component->VERSION;
148         if ( $version eq '' ) {
149             $version = 'unknown';
150         }
151     }
152     else {
153         $version = 'module is missing';
154     }
155     push(
156         @components,
157         {
158             name    => $component,
159             version => $version,
160             newrow  => (++$counter % 4) ? 0 : 1,
161         }
162     );
163 }
164
165 $template->param( components => \@components );
166
167 output_html_with_http_headers $query, $cookie, $template->output;