1
0
Fork 0

Add php proxies to replacement vars.

pull/886/head
Alexey Prilipko 2012-07-05 23:44:25 +11:00
parent 3bdae180f6
commit bc2d30492a
1 changed files with 8 additions and 6 deletions

View File

@ -54,20 +54,22 @@ class PearInstaller extends LibraryInstaller
parent::installCode($package); parent::installCode($package);
$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'));
$installPath = $this->getInstallPath($package);
$vars = array( $vars = array(
'os' => $isWindows ? 'windows' : 'linux', 'os' => $isWindows ? 'windows' : 'linux',
'php_bin' => ($isWindows ? getenv('PHPRC') .'php.exe' : trim(`which php`)), 'php_bin' => $php_bin,
'pear_php' => $this->getInstallPath($package), 'pear_php' => $installPath,
'bin_dir' => $this->getInstallPath($package) . '/bin', 'php_dir' => $installPath,
'php_dir' => $this->getInstallPath($package), 'bin_dir' => $installPath . '/bin',
'data_dir' => '@DATA_DIR@', 'data_dir' => $installPath . '/data',
'version' => $package->getPrettyVersion(), 'version' => $package->getPrettyVersion(),
); );
$packageArchive = $this->getInstallPath($package).'/'.pathinfo($package->getDistUrl(), PATHINFO_BASENAME); $packageArchive = $this->getInstallPath($package).'/'.pathinfo($package->getDistUrl(), PATHINFO_BASENAME);
$pearExtractor = new PearPackageExtractor($packageArchive); $pearExtractor = new PearPackageExtractor($packageArchive);
$pearExtractor->extractTo($this->getInstallPath($package), array('php' => '/', 'script' => '/bin'), $vars); $pearExtractor->extractTo($this->getInstallPath($package), array('php' => '/', 'script' => '/bin', 'data' => '/data'), $vars);
if ($this->io->isVerbose()) { if ($this->io->isVerbose()) {
$this->io->write(' Cleaning up'); $this->io->write(' Cleaning up');