composer没有解压缩bzip2包类型存档

时间:2017-12-18 13:35:49

标签: composer-php

我正在尝试在作曲家中使用bzip包:

{
    "name": "<my-proj-name>",
    "optimize-autoloader": true,
    "classmap-authoritative": true,
    "config": {
      "secure-http": false
    },
    "autoload":{
        "psr-0":{
            "":"src/"
        }
    },
    "repositories": [
      {
        "type":"package",
        "package":{
          "name":"<my-local-lib-name>",
          "version":"15.0.0",
          "dist":{
            "url":"file:///Users/<mypath>/test.tar.bz2",
            "type":"tar"
          },
          "autoload":{
            "classmap":["./"]
          }
        }
      }
    ],
    "require": {
      "<my-local-lib-name>":"*"
    }
}

但我得到的是以下错误:

MacBook-Pro-de-Matteo:proj myusername$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing mylib/mylib (15.0.0): Downloading (100%)         


  [PharException]                                                                                                                                           
  Extraction from phar "/<path>/<hash>.bz2" failed:   
  Cannot extract ".", internal error    

我没有任何其他信息,也不知道如何调试此信息。手动完全通过tar提取文件,我的本地PHP似乎与bzip2一起编译:

MacBook-Pro-de-Matteo:Downloads mbertamini$ php -i | grep -i bz2
Configure Command =>  './configure'  '--prefix=/usr/local/Cellar/php70/7.0.25_17' '--localstatedir=/usr/local/var' '--sysconfdir=/usr/local/etc/php/7.0' '--with-config-file-path=/usr/local/etc/php/7.0' '--with-config-file-scan-dir=/usr/local/etc/php/7.0/conf.d' '--mandir=/usr/local/Cellar/php70/7.0.25_17/share/man' '--enable-bcmath' '--enable-calendar' '--enable-dba' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-mbregex' '--enable-mbstring' '--enable-shmop' '--enable-soap' '--enable-sockets' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx' '--enable-zip' '--with-freetype-dir=/usr/local/opt/freetype' '--with-gd' '--with-gettext=/usr/local/opt/gettext' '--with-iconv-dir=/usr' '--with-icu-dir=/usr/local/opt/icu4c' '--with-jpeg-dir=/usr/local/opt/jpeg' '--with-kerberos=/usr' '--with-mhash' '--with-ndbm=/usr' '--with-png-dir=/usr/local/opt/libpng' '--with-xmlrpc' '--with-zlib=/usr' '--with-readline=/usr/local/opt/readline' '--without-gmp' '--without-snmp' '--with-libxml-dir=/usr/local/opt/libxml2' '--with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc' '--with-unixODBC=/usr/local/opt/unixodbc' '--with-bz2=/usr' '--with-openssl=/usr/local/opt/openssl' '--enable-fpm' '--with-fpm-user=_www' '--with-fpm-group=_www' '--with-curl' '--with-xsl=/usr' '--with-ldap' '--with-ldap-sasl=/usr' '--with-mysql-sock=/tmp/mysql.sock' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--disable-opcache' '--enable-pcntl' '--without-pear' '--enable-dtrace' '--disable-phpdbg' '--enable-zend-signals'
bz2

有关错误的更多信息

安装时添加-vvv详细选项我得到以下stacktrace:

Exception trace:
 () at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/TarDownloader.php:29
 PharData->extractTo() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/TarDownloader.php:29
 Composer\Downloader\TarDownloader->extract() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/ArchiveDownloader.php:43
 Composer\Downloader\ArchiveDownloader->download() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Downloader/DownloadManager.php:213
 Composer\Downloader\DownloadManager->download() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/LibraryInstaller.php:186
 Composer\Installer\LibraryInstaller->installCode() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/LibraryInstaller.php:90
 Composer\Installer\LibraryInstaller->install() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/InstallationManager.php:173
 Composer\Installer\InstallationManager->install() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer/InstallationManager.php:160
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer.php:587
 Composer\Installer->doInstall() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Installer.php:223
 Composer\Installer->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Command/InstallCommand.php:119
 Composer\Command\InstallCommand->execute() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Command/Command.php:266
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:861
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:208
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Console/Application.php:245
 Composer\Console\Application->doRun() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/vendor/symfony/console/Application.php:127
 Symfony\Component\Console\Application->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/src/Composer/Console/Application.php:100
 Composer\Console\Application->run() at phar:///usr/local/Cellar/composer/1.5.2/libexec/composer.phar/bin/composer:54
 require() at /usr/local/Cellar/composer/1.5.2/libexec/composer.phar:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

1 个答案:

答案 0 :(得分:1)

这是我报道的一个错误。以下是该问题的官方链接:

https://github.com/composer/composer/issues/6916