1
0
Fork 0

Merge branch '1.1'

pull/5303/head
Jordi Boggiano 2016-05-10 15:20:41 +01:00
commit 921af1c1b8
3 changed files with 17 additions and 8 deletions

View File

@ -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 ### [1.1.0-RC] - 2016-04-29
* Added ability for plugins to register their own composer commands * Added ability for plugins to register their own composer commands

10
composer.lock generated
View File

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

View File

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