X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInstallationCheck.pm;h=15db0cb70fb26246579cff28311ad8e46d3d0a17;hb=1465be33b0432ed41208b8f913f2bc4f54ef5d78;hp=cf523be2a3b468ae0803518ff00578089e92092c;hpb=98c1b72fe5452b3c5b8c6128ea548e40d4b360c1;p=kivitendo-erp.git diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index cf523be2a..15db0cb70 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -7,63 +7,50 @@ use vars qw(@required_modules @optional_modules); use strict; +BEGIN { @required_modules = ( - { name => "Archive::Zip", url => "http://search.cpan.org/~adamk/" }, - { name => "Class::Accessor", url => "http://search.cpan.org/~kasei/" }, - { name => "CGI::Ajax", url => "http://search.cpan.org/~bct/" }, - { name => "DBI", url => "http://search.cpan.org/~timb/" }, - { name => "DBD::Pg", url => "http://search.cpan.org/~dbdpg/" }, - { name => "Email::Address", url => "http://search.cpan.org/~rjbs/" }, - { name => "FCGI", url => "http://search.cpan.org/~mstrout/" }, - { name => "IO::Wrap", url => "http://search.cpan.org/~dskoll/" }, - { name => "List::MoreUtils", url => "http://search.cpan.org/~vparseval/" }, - { name => "PDF::API2", url => "http://search.cpan.org/~areibens/" }, - { name => "Template", url => "http://search.cpan.org/~abw/" }, - { name => "Text::CSV_XS", url => "http://search.cpan.org/~hmbrand/" }, - { name => "Text::Iconv", url => "http://search.cpan.org/~mpiotr/" }, - { name => "URI", url => "http://search.cpan.org/~gaas/" }, - { name => "XML::Writer", url => "http://search.cpan.org/~josephw/" }, - { name => "YAML", url => "http://search.cpan.org/~ingy/" }, + { name => "parent", url => "http://search.cpan.org/~corion/" }, + { name => "Archive::Zip", version => '1.16', url => "http://search.cpan.org/~adamk/" }, + { name => "Class::Accessor", version => '0.30', url => "http://search.cpan.org/~kasei/" }, + { name => "CGI::Ajax", version => '0.697', url => "http://search.cpan.org/~bct/" }, + { name => "DateTime", url => "http://search.cpan.org/~drolsky/" }, + { name => "DBI", version => '1.50', url => "http://search.cpan.org/~timb/" }, + { name => "DBD::Pg", version => '1.49', url => "http://search.cpan.org/~dbdpg/" }, + { name => "Email::Address", url => "http://search.cpan.org/~rjbs/" }, + { name => "FCGI", url => "http://search.cpan.org/~mstrout/" }, + { name => "List::MoreUtils", version => '0.21', url => "http://search.cpan.org/~vparseval/" }, + { name => "PDF::API2", version => '2.000', url => "http://search.cpan.org/~areibens/" }, + { name => "Template", version => '2.18', url => "http://search.cpan.org/~abw/" }, + { name => "Text::CSV_XS", version => '0.23', url => "http://search.cpan.org/~hmbrand/" }, + { name => "Text::Iconv", version => '1.2', url => "http://search.cpan.org/~mpiotr/" }, + { name => "URI", version => '1.35', url => "http://search.cpan.org/~gaas/" }, + { name => "XML::Writer", version => '0.602', url => "http://search.cpan.org/~josephw/" }, + { name => "YAML", version => '0.62', url => "http://search.cpan.org/~ingy/" }, ); @optional_modules = (); +$_->{fullname} = join ' ', grep $_, @$_{qw(name version)} + for @required_modules, @optional_modules; +} + sub module_available { - my ($module) = @_; + my $module = $_[0]; + my $version = $_[1] || '' ; - if (!defined(eval("require $module;"))) { - return 0; - } else { - return 1; - } + return eval "use $module $version; 1"; } my %conditional_dependencies; sub check_for_conditional_dependencies { - if (!$conditional_dependencies{net_ldap}) { - $conditional_dependencies{net_ldap} = 1; - - my $in = IO::File->new('config/authentication.pl', 'r'); - if ($in) { - my $self = {}; - my $code; - - while (my $line = <$in>) { - $code .= $line; - } - $in->close(); - - eval $code; + return if $conditional_dependencies{net_ldap}++; - if (! $EVAL_ERROR) { + my $self = {}; + eval do { local (@ARGV, $/) = 'config/authentication.pl'; <> } or return; - if ($self->{module} && ($self->{module} eq 'LDAP')) { - push @required_modules, { 'name' => 'Net::LDAP', 'url' => 'http://search.cpan.org/~gbarr/' }; - } - } - } - } + push @required_modules, { 'name' => 'Net::LDAP', 'url' => 'http://search.cpan.org/~gbarr/' } + if $self->{module} && ($self->{module} eq 'LDAP'); } sub test_all_modules {