summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-12-17 23:32:21 +0100
committerFlorian Pritz <bluewind@xinu.at>2011-12-17 23:32:21 +0100
commit67916cce79826b968925bd7193ff1c202384dad3 (patch)
tree3104db6891255986c0b43d1a67d366d1812d1e82
parent1104ea8fea5098ff0ef5e6388d5fdf353784f679 (diff)
use PATH in install.php; fix qrencode test
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r--install.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/install.php b/install.php
index 2ebf2dc27..d30564bf3 100644
--- a/install.php
+++ b/install.php
@@ -9,6 +9,9 @@ $errors = "";
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('FCPATH', str_replace(SELF, "", __FILE__));
+$old_path = getenv("PATH");
+putenv("PATH=$old_path:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin");
+
// test exec()
exec("echo -n works") == "works" || $errors .= "exec() failed\n";
@@ -21,7 +24,7 @@ $buf == "works" || $errors .= "passthru() failed\n";
// test perl HTML::FromANSI
ob_start();
-passthru("/usr/bin/perl ".FCPATH."/scripts/install_helper.pl");
+passthru("perl ".FCPATH."/scripts/install_helper.pl");
$buf = ob_get_contents();
ob_end_clean();
if ($buf != "works") {
@@ -35,13 +38,11 @@ if (!class_exists("Memcache")) {
}
// test qrencode
-$expected = base64_decode("iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdAQAAAAB+6FqiAAAAbklEQVQImWP4DwQMaMQHWYd6hu/34+sZvoReBBLxgUAiCkh8v3G/nuGDKFD2/1eguo+ssv8ZftWsq2f4e6+jnuGrkhqQe60LKPvxNkhdEVDH5Xv/Gb4EBwENiFkHZAX1AsWuKAHtEOqpR7cXRAAANwpWESFdK+4AAAAASUVORK5CYII=");
ob_start();
-passthru("/usr/bin/qrencode -s 1 -o - \"test\"");
-$buf = ob_get_contents();
+passthru("qrencode -V 2>&1", $buf);
ob_end_clean();
-if ($buf != $expected) {
- $errors .= " - Error when testing qrencode: Didn't get expected output when encoding string \"test\".\n";
+if ($buf != "0") {
+ $errors .= " - Error when testing qrencode: Return code was \"$buf\".\n";
}