com web/rmtools: Use relative path: include/PeclExt.php

From: Date: Tue, 05 Sep 2017 18:39:57 +0000
Subject: com web/rmtools: Use relative path: include/PeclExt.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-26375@lists.php.net to get a copy of this message
Commit: d4ec65a9388b15ce8f5dbfc36297fada42386c0a Author: Anatol Belski <ab@php.net> 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; }

« previous php.webmaster (#26375) next »