diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-02-14 16:59:07 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-02-14 16:59:07 +0100 |
commit | 6a3c88a7b4df3310a931a4e4452d59a21adf1c7c (patch) | |
tree | d018177f2e2f2f216ffa0da43c13f9a04dd1261a | |
parent | 74f57266a0b422d6ce06f9da2d9e94ff123b60b1 (diff) |
install.php: rework perl dependency check
It now displays all missing modules at once rather than requiring to be
run again.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | install.php | 24 | ||||
-rwxr-xr-x | scripts/install_helper.pl | 8 |
2 files changed, 15 insertions, 17 deletions
diff --git a/install.php b/install.php index de0f266f0..c80626ffe 100644 --- a/install.php +++ b/install.php @@ -26,14 +26,21 @@ $buf = ob_get_contents(); ob_end_clean(); $buf == "works" || $errors .= "passthru() failed\n"; -// test perl HTML::FromANSI -ob_start(); -passthru("perl 2>&1 ".FCPATH."/scripts/install_helper.pl"); -$buf = ob_get_contents(); -ob_end_clean(); -if ($buf != "works") { - $errors .= " - Error when running perl tests.\n"; - $errors .= nl2br($buf); +// test perl deps +$perldeps = array( + "HTML::FromANSI", + "File::MimeInfo::Magic", + "Text::Markdown" +); +foreach ($perldeps as $dep) { + ob_start(); + passthru("perl 2>&1 -M'$dep' -e1"); + $buf = ob_get_contents(); + ob_end_clean(); + if ($buf != "") { + $errors .= " - failed to find perl module: $dep.\n"; + $errors .= $buf; + } } // test memcache @@ -51,7 +58,6 @@ if ($buf != "0") { if ($errors != "") { - echo nl2br("\n\n"); echo nl2br("Errors occured:\n"); echo nl2br($errors); } else { diff --git a/scripts/install_helper.pl b/scripts/install_helper.pl deleted file mode 100755 index eecf50cf1..000000000 --- a/scripts/install_helper.pl +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use File::MimeInfo::Magic; -use HTML::FromANSI; -use Text::Markdown qw(markdown); - -print "works"; |