Commit:    d4ec65a9388b15ce8f5dbfc36297fada42386c0a
Author:    Anatol Belski <[email protected]>         Tue, 5 Sep 2017 20:39:57 +0200
Parents:   bc921ece7ecb620e6ddbfd4b0fde2b3c0a21e740
Branches:  master

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

Log:
Use relative path

Changed paths:
  M  include/PeclExt.php


Diff:
diff --git a/include/PeclExt.php b/include/PeclExt.php
index d27950c..42632ea 100644
--- a/include/PeclExt.php
+++ b/include/PeclExt.php
@@ -884,15 +884,19 @@ if (!function_exists('rmtools\combinations')) {
 nodoc:
 
                /* pack */
-               /* XXX implement the packaging of original fs structure from 
package.xml */
+               $old_cwd = getcwd();
+               chdir($target);
                $zip_file = TMP_DIR . DIRECTORY_SEPARATOR . 
$this->getPackageName() . '.zip';
                foreach ($files_to_zip as $file_to_zip) {
-                       $zip_cmd = $this->zip_cmd . ' -9 ' . $zip_file . ' ' . 
$file_to_zip;
+                       $actual_fn = substr($file_to_zip, strlen($target)+1)
+                       $zip_cmd = $this->zip_cmd . ' -9 ' . $zip_file . ' ' . 
$actual_fn;
                        system($zip_cmd, $status);
                        if ($status) {
+                               chdir($old_cwd);
                                throw new \Exception("Couldn't zip files for 
'$zip_file'");
                        }
                }
+               chdir($old_cwd);
 
                return $zip_file;
        }


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

Reply via email to