Commit:    3f8db17f2915de51ea3f03aa793a4f4a9cb63879
Author:    Anatol Belski <[email protected]>         Tue, 5 Sep 2017 19:57:30 +0200
Parents:   27c93410fb49207c14da06959d7888bcc026cb56
Branches:  master

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

Log:
Preserve file structure from package.xml

Changed paths:
  M  include/PeclExt.php


Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index 66aa39d..9d90285 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -852,7 +852,7 @@ if (!function_exists('rmtools\combinations')) {
 
                                $tgt_fl = $target
                                        . DIRECTORY_SEPARATOR
-                                       . basename((string)$file["name"]);
+                                       . (string)$file["name"];
 
                                if (file_exists($tgt_fl)) {
                                        continue;
@@ -862,7 +862,14 @@ if (!function_exists('rmtools\combinations')) {
                                if (in_array($tgt_fl, $files_to_zip)) {
                                        continue;
                                }
-       
+
+                               $tgt_dir = dirname($tgt_fl);
+                               if (!is_dir($tgt_dir)) {
+                                       if (!mkdir($tgt_dir, 0777, true)) {
+                                               throw new \Exception("Failed to 
create '$tgt_dir'");
+                                       }
+                               }
+
                                if (!copy($src_fl, $tgt_fl)) {
                                        /* XXX actually it's not fatal, lets 
observe */
                                        throw new \Exception("Failed to copy 
doc file '$src_fl' "


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

Reply via email to