X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInstallationCheck.pm;h=c2b309f25c5767b32ef21b93401655516d407fc0;hb=73a404b58ebe0de883558b898ee07ae3499461b7;hp=dc2a124f072a21dbe53f0ffa8046c48cc48f9fb8;hpb=4e3d7a2e64528970fb1927526a289f9b0c76f409;p=kivitendo-erp.git diff --git a/SL/InstallationCheck.pm b/SL/InstallationCheck.pm index dc2a124f0..c2b309f25 100644 --- a/SL/InstallationCheck.pm +++ b/SL/InstallationCheck.pm @@ -1,6 +1,11 @@ package SL::InstallationCheck; -use vars qw(@required_modules); +use English '-no_match_vars'; +use IO::File; + +use vars qw(@required_modules @optional_modules); + +use strict; @required_modules = ( { "name" => "Class::Accessor", "url" => "http://search.cpan.org/~kasei/" }, @@ -8,7 +13,6 @@ use vars qw(@required_modules); { "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" => "HTML::Template", "url" => "http://search.cpan.org/~samtregar/" }, { "name" => "Archive::Zip", "url" => "http://search.cpan.org/~adamk/" }, { "name" => "Text::Iconv", "url" => "http://search.cpan.org/~mpiotr/" }, { "name" => "Time::HiRes", "url" => "http://search.cpan.org/~jhi/" }, @@ -16,6 +20,13 @@ use vars qw(@required_modules); { "name" => "IO::Wrap", "url" => "http://search.cpan.org/~dskoll/" }, { "name" => "Text::CSV_XS", "url" => "http://search.cpan.org/~hmbrand/" }, { "name" => "List::Util", "url" => "http://search.cpan.org/~gbarr/" }, + { "name" => "Template", "url" => "http://search.cpan.org/~abw/" }, + { "name" => "Digest::MD5", "url" => "http://search.cpan.org/~gaas/" }, + { "name" => "PDF::API2", "url" => "http://search.cpan.org/~areibens/" }, + { "name" => "XML::Writer", "url" => "http://search.cpan.org/~josephw/" }, + ); + +@optional_modules = ( ); sub module_available { @@ -28,6 +39,34 @@ sub module_available { } } +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; + + if (! $EVAL_ERROR) { + + if ($self->{module} && ($self->{module} eq 'LDAP')) { + push @required_modules, { 'name' => 'Net::LDAP', 'url' => 'http://search.cpan.org/~gbarr/' }; + } + } + } + } +} + sub test_all_modules { return grep { !module_available($_->{name}) } @required_modules; }