com web/rmtools: improve php source dir check: include/PeclExt.php
| From: | Anatol Belski | Date: | Fri, 14 Jul 2017 10:14:09 +0000 |
| Subject: | com web/rmtools: improve php source dir check: include/PeclExt.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-26206@lists.php.net to get a copy of this message | ||
Commit: 0e0ac758331fe12c8db2abd691a06d70ef9367e3
Author: Anatol Belski <ab@php.net> Fri, 14 Jul 2017 12:14:09 +0200
Parents: 2f5c696baf6e53935e099a21e873122dda199157
Branches: master
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=0e0ac758331fe12c8db2abd691a06d70ef9367e3
Log:
improve php source dir check
Changed paths:
M include/PeclExt.php
Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index 0e7529d..6807396 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -964,7 +964,11 @@ nodoc:
$max_php_ver = (string)$this->getPackageXmlProperty("dependencies",
"required", "php", "max");
$php_ver = '';
- $ver_hdr = $this->build->getSourceDir() . '/main/php_version.h';
+ $ver_dir = $this->build->getSourceDir();
+ if (!$ver_dir || !is_dir($ver_dir)) {
+ throw new \Exception("Could not stat source directory at '$ver_dir'.");
+ }
+ $ver_hdr = $ver_dir . '/main/php_version.h';
if(preg_match(',#define PHP_VERSION "(.*)",Sm', file_get_contents($ver_hdr),
$m)) {
$php_ver = $m[1];
} else {