Browse Source

Use trim filter on 'php' location

Alexey Prilipko 12 years ago
parent
commit
59773dd9f6

+ 3 - 2
src/Composer/Downloader/PearPackageExtractor.php

@@ -163,9 +163,10 @@ class PearPackageExtractor
     private function applyRelease(&$actions, $releaseNodes, $vars)
     {
         foreach ($releaseNodes as $releaseNode) {
-            $requiredOs = (string) ($releaseNode->installconditions && $releaseNode->installconditions->os && $releaseNode->installconditions->os->name) ?: '';
-            if ($requiredOs && $vars['os'] != $requiredOs)
+            $requiredOs = $releaseNode->installconditions && $releaseNode->installconditions->os && $releaseNode->installconditions->os->name ? (string) $releaseNode->installconditions->os->name : '';
+            if ($requiredOs && $vars['os'] != $requiredOs) {
                 continue;
+            }
 
             if ($releaseNode->filelist) {
                 foreach ($releaseNode->filelist->children() as $action) {

+ 1 - 1
src/Composer/Installer/PearInstaller.php

@@ -62,7 +62,7 @@ class PearInstaller extends LibraryInstaller
 
         $vars = array(
             'os' => $isWindows ? 'windows' : 'linux',
-            'php_bin' => ($isWindows ? getenv('PHPRC') .'php.exe' : `which php`),
+            'php_bin' => ($isWindows ? getenv('PHPRC') .'php.exe' : trim(`which php`)),
             'pear_php' => $this->getInstallPath($package),
             'bin_dir' => $this->getInstallPath($package) . '/bin',
             'php_dir' => $this->getInstallPath($package),