Skip to content

Commit

Permalink
restore ExtensionInstallerTest.php, modify ExtensionInstaller.php
Browse files Browse the repository at this point in the history
  • Loading branch information
scarwu committed Mar 24, 2014
1 parent f6b4180 commit 14a29f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/PhpBrew/ExtensionInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ public function installFromPecl($packageName, $version = 'stable', $configureOpt
$downloader = new Downloader\UrlDownloader($this->logger);
$basename = $downloader->download($url);
$info = pathinfo($basename);

$extension_dir = getcwd() . "/$packageName";

// extract
$this->logger->info("===> Extracting $basename...");
Utils::system("tar xf $basename");
Utils::system("rm -rf $packageName");
Utils::system("mv {$info['filename']} $packageName");
Utils::system("mv package.xml $packageName");

return $this->runInstall($packageName, $packageName, $configureOptions);
return $this->runInstall($packageName, $extension_dir, $configureOptions);
}

public function runInstall($packageName, $dir, $configureOptions)
Expand Down
2 changes: 1 addition & 1 deletion tests/PhpBrew/ExtensionInstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testInstallPackages($packageName)
ok($installer);
$installedPath = $installer->installFromPecl($packageName);
chdir('..');
path_ok( getcwd() . "/tmp/$installedPath" );
path_ok( $installedPath );
}
}

0 comments on commit 14a29f8

Please sign in to comment.