Commit:    66213365c3bee5d895be17b2b817bb98c5f6a6f6
Author:    Anatol Belski <[email protected]>         Thu, 12 Sep 2013 16:44:08 +0200
Parents:   eaeb621e107cd4dc2e92ac903431e5b4f36f9863
Branches:  master

Link:       
http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=66213365c3bee5d895be17b2b817bb98c5f6a6f6

Log:
it's not reliable to read the pkg name from filename, fixed

Changed paths:
  M  client/include/PeclExt.php


Diff:
diff --git a/client/include/PeclExt.php b/client/include/PeclExt.php
index c7d1edb..337aa1f 100644
--- a/client/include/PeclExt.php
+++ b/client/include/PeclExt.php
@@ -52,12 +52,21 @@ class PeclExt
 
                if (!$this->name || !$this->version) {
                        /* This is the fallback if there's no package.xml  */
-                       $tmp = explode('-', $this->pkg_basename);
-                       $this->name = !$this->name ? $tmp[0] : $this->name;
-                       $this->version = !$this->version ? $tmp[1] : 
$this->version;
+                       if (!$this->name) {
+                               $config_w32_path = $this->tmp_extract_path . 
DIRECTORY_SEPARATOR . 'config.w32';
+                               foreach (array('ARG_ENABLE', 'ARG_WITH') as 
$str) {
+                                       if 
(preg_match("/$str\s*\(\s*('|\")([a-z0-9_]+)('|\")\s*,/Sm", 
file_get_contents($config_w32_path), $m)) {
+                                               $this->name = $m[2];
+                                       }
+                               }
+                       }
+
+                       if (!$this->name) {
+                               throw new \Exception("Couldn't reliably 
determine the package name, please fix or add package.xml");
+                       }
 
-                       if (!$this->name || !$this->version) {
-                               throw new \Exception("Couldn't parse extension 
name or version neither from package.xml nor from the filename");
+                       if (!$this->version) {
+                               $this->version = date('Ymd');
                        }
                }


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

Reply via email to