소스 검색

Merge branch '1.1'

Jordi Boggiano 9 년 전
부모
커밋
921af1c1b8
3개의 변경된 파일17개의 추가작업 그리고 8개의 파일을 삭제
  1. 6 0
      CHANGELOG.md
  2. 5 5
      composer.lock
  3. 6 3
      src/Composer/Package/Archiver/ZipArchiver.php

+ 6 - 0
CHANGELOG.md

@@ -1,3 +1,9 @@
+### [1.1.0] - 2016-05-10
+
+  * Added fallback to SSH for https bitbucket URLs
+  * Added BaseCommand::isProxyCommand that can be overriden to mark a command as being a mere proxy, which helps avoid duplicate warnings etc on composer startup
+  * Fixed archiving generating long paths in zip files on Windows
+
 ### [1.1.0-RC] - 2016-04-29
 
   * Added ability for plugins to register their own composer commands

+ 5 - 5
composer.lock

@@ -429,7 +429,7 @@
         },
         {
             "name": "symfony/console",
-            "version": "v2.8.5",
+            "version": "v2.8.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
@@ -489,7 +489,7 @@
         },
         {
             "name": "symfony/filesystem",
-            "version": "v2.8.5",
+            "version": "v2.8.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/filesystem.git",
@@ -538,7 +538,7 @@
         },
         {
             "name": "symfony/finder",
-            "version": "v2.8.5",
+            "version": "v2.8.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/finder.git",
@@ -646,7 +646,7 @@
         },
         {
             "name": "symfony/process",
-            "version": "v2.8.5",
+            "version": "v2.8.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/process.git",
@@ -1600,7 +1600,7 @@
         },
         {
             "name": "symfony/yaml",
-            "version": "v2.8.5",
+            "version": "v2.8.6",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",

+ 6 - 3
src/Composer/Package/Archiver/ZipArchiver.php

@@ -13,6 +13,7 @@
 namespace Composer\Package\Archiver;
 
 use ZipArchive;
+use Composer\Util\Filesystem;
 
 /**
  * @author Jan Prieser <jan@prieser.net>
@@ -28,15 +29,17 @@ class ZipArchiver implements ArchiverInterface
      */
     public function archive($sources, $target, $format, array $excludes = array())
     {
-        $sources = realpath($sources);
+        $fs = new Filesystem();
+        $sources = $fs->normalizePath($sources);
+
         $zip = new ZipArchive();
         $res = $zip->open($target, ZipArchive::CREATE);
         if ($res === true) {
             $files = new ArchivableFilesFinder($sources, $excludes);
             foreach ($files as $file) {
                 /** @var $file \SplFileInfo */
-                $filepath = $file->getPath()."/".$file->getFilename();
-                $localname = str_replace($sources."/", '', $filepath);
+                $filepath = strtr($file->getPath()."/".$file->getFilename(), '\\', '/');
+                $localname = str_replace($sources.'/', '', $filepath);
                 if ($file->isDir()) {
                     $zip->addEmptyDir($localname);
                 } else {