com web/rmtools: Fix tools lookup: include/PeclExt.php
| From: | Anatol Belski | Date: | Tue, 05 Sep 2017 16:26:37 +0000 |
| Subject: | com web/rmtools: Fix tools lookup: include/PeclExt.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26368@lists.php.net to get a copy of this message | ||
Commit: 1a4f497896692748efc5a9cf37f61094be9848c9
Author: Anatol Belski <ab@php.net> Tue, 5 Sep 2017 18:26:37 +0200
Parents: 2b4b5f06559216bf905fe603b9e4c92a2bc8bef0
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=1a4f497896692748efc5a9cf37f61094be9848c9
Log:
Fix tools lookup
Changed paths:
M include/PeclExt.php
Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index b5df59b..1fed1e3 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -1206,13 +1206,18 @@ nodoc:
protected function getToolFilepath($tool, $hard_error = true)
{
- $path =
where $tool;
- $path = trim($path);
+ $path = NULL;
- if (!$path && $hard_error) {
+ exec("where $tool", $out, $st);
+
+ if (($st || count($out) < 1) && $hard_error) {
throw new \Exception("'$tool' not found.");
}
+ if (isset($out[0])) {
+ $path = trim($out[0]);
+ }
+
return $path;
}
}