diff --git a/src/Composer/Installer/InstallationManager.php b/src/Composer/Installer/InstallationManager.php index ca8035eda..6ac4fca50 100644 --- a/src/Composer/Installer/InstallationManager.php +++ b/src/Composer/Installer/InstallationManager.php @@ -23,7 +23,6 @@ use Composer\DependencyResolver\Operation\UpdateOperation; use Composer\DependencyResolver\Operation\UninstallOperation; use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation; use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation; -use Composer\Util\Filesystem; /** * Package operation manager. diff --git a/src/Composer/Installer/PearInstaller.php b/src/Composer/Installer/PearInstaller.php index edc901438..8cea866d9 100644 --- a/src/Composer/Installer/PearInstaller.php +++ b/src/Composer/Installer/PearInstaller.php @@ -15,10 +15,8 @@ namespace Composer\Installer; use Composer\IO\IOInterface; use Composer\Composer; use Composer\Downloader\PearPackageExtractor; -use Composer\Downloader\DownloadManager; use Composer\Repository\InstalledRepositoryInterface; use Composer\Package\PackageInterface; -use Composer\Util\Filesystem; /** * Package installation manager. @@ -31,9 +29,9 @@ class PearInstaller extends LibraryInstaller /** * Initializes library installer. * - * @param IOInterface $io io instance - * @param Composer $composer - * @param string $type package type that this installer handles + * @param IOInterface $io io instance + * @param Composer $composer + * @param string $type package type that this installer handles */ public function __construct(IOInterface $io, Composer $composer, $type = 'pear-library') { @@ -52,9 +50,10 @@ class PearInstaller extends LibraryInstaller protected function installCode(PackageInterface $package) { parent::installCode($package); + parent::initializeBinDir(); $isWindows = defined('PHP_WINDOWS_VERSION_BUILD') ? true : false; - $php_bin = realpath($this->binDir . ($isWindows ? '/composer-php.bat' : '/composer-php')); + $php_bin = $this->binDir . ($isWindows ? '/composer-php.bat' : '/composer-php'); $installPath = $this->getInstallPath($package); $vars = array( @@ -82,8 +81,10 @@ class PearInstaller extends LibraryInstaller $binariesPath = $this->getInstallPath($package) . '/bin/'; $binaries = array(); if (file_exists($binariesPath)) { - foreach (new \FilesystemIterator($binariesPath, \FilesystemIterator::KEY_AS_FILENAME) as $fileName => $value) { - $binaries[] = 'bin/'.$fileName; + foreach (new \FilesystemIterator($binariesPath, \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_FILEINFO) as $fileName => $value) { + if (!$value->isDir()) { + $binaries[] = 'bin/'.$fileName; + } } }