Commit:    0e0ac758331fe12c8db2abd691a06d70ef9367e3
Author:    Anatol Belski <[email protected]>         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 {


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to