Exclude dirs from list of binaries

main
Alexey Prilipko 12 years ago
parent bc2d30492a
commit 22d41845ae

@ -23,7 +23,6 @@ use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\DependencyResolver\Operation\UninstallOperation; use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation; use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation;
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation; use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
use Composer\Util\Filesystem;
/** /**
* Package operation manager. * Package operation manager.

@ -15,10 +15,8 @@ namespace Composer\Installer;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\Composer; use Composer\Composer;
use Composer\Downloader\PearPackageExtractor; use Composer\Downloader\PearPackageExtractor;
use Composer\Downloader\DownloadManager;
use Composer\Repository\InstalledRepositoryInterface; use Composer\Repository\InstalledRepositoryInterface;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Util\Filesystem;
/** /**
* Package installation manager. * Package installation manager.
@ -31,9 +29,9 @@ class PearInstaller extends LibraryInstaller
/** /**
* Initializes library installer. * Initializes library installer.
* *
* @param IOInterface $io io instance * @param IOInterface $io io instance
* @param Composer $composer * @param Composer $composer
* @param string $type package type that this installer handles * @param string $type package type that this installer handles
*/ */
public function __construct(IOInterface $io, Composer $composer, $type = 'pear-library') public function __construct(IOInterface $io, Composer $composer, $type = 'pear-library')
{ {
@ -52,9 +50,10 @@ class PearInstaller extends LibraryInstaller
protected function installCode(PackageInterface $package) protected function installCode(PackageInterface $package)
{ {
parent::installCode($package); parent::installCode($package);
parent::initializeBinDir();
$isWindows = defined('PHP_WINDOWS_VERSION_BUILD') ? true : false; $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); $installPath = $this->getInstallPath($package);
$vars = array( $vars = array(
@ -82,8 +81,10 @@ class PearInstaller extends LibraryInstaller
$binariesPath = $this->getInstallPath($package) . '/bin/'; $binariesPath = $this->getInstallPath($package) . '/bin/';
$binaries = array(); $binaries = array();
if (file_exists($binariesPath)) { if (file_exists($binariesPath)) {
foreach (new \FilesystemIterator($binariesPath, \FilesystemIterator::KEY_AS_FILENAME) as $fileName => $value) { foreach (new \FilesystemIterator($binariesPath, \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::CURRENT_AS_FILEINFO) as $fileName => $value) {
$binaries[] = 'bin/'.$fileName; if (!$value->isDir()) {
$binaries[] = 'bin/'.$fileName;
}
} }
} }

Loading…
Cancel
Save