本文整理汇总了PHP中PhpBrew\Config::getCurrentPhpConfigBin方法的典型用法代码示例。如果您正苦于以下问题:PHP Config::getCurrentPhpConfigBin方法的具体用法?PHP Config::getCurrentPhpConfigBin怎么用?PHP Config::getCurrentPhpConfigBin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpBrew\Config
的用法示例。
在下文中一共展示了Config::getCurrentPhpConfigBin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: install
public function install(Extension $ext, array $configureOptions = array())
{
$sourceDir = $ext->getSourceDirectory();
$pwd = getcwd();
$buildLogPath = $sourceDir . DIRECTORY_SEPARATOR . 'build.log';
$make = new MakeTask($this->logger, $this->options);
$make->setBuildLogPath($buildLogPath);
$this->logger->info("Log stored at: {$buildLogPath}");
$this->logger->info("Changing directory to {$sourceDir}");
chdir($sourceDir);
if (!$this->options->{'no-clean'} && $ext->isBuildable()) {
$clean = new MakeTask($this->logger, $this->options);
$clean->setQuiet();
$clean->clean($ext);
}
if ($ext->getConfigM4File() !== "config.m4" && !file_exists($sourceDir . DIRECTORY_SEPARATOR . 'config.m4')) {
symlink($ext->getConfigM4File(), $sourceDir . DIRECTORY_SEPARATOR . 'config.m4');
}
// If the php version is specified, we should get phpize with the correct version.
$this->logger->info('===> Phpize...');
Utils::system("phpize > {$buildLogPath} 2>&1", $this->logger);
// here we don't want to use closure, because
// 5.2 does not support closure. We haven't decided whether to
// support 5.2 yet.
$escapeOptions = array_map('escapeshellarg', $configureOptions);
$this->logger->info("===> Configuring...");
$phpConfig = Config::getCurrentPhpConfigBin();
if (file_exists($phpConfig)) {
$this->logger->debug("Appending argument: --with-php-config={$phpConfig}");
$escapeOptions[] = '--with-php-config=' . $phpConfig;
}
// Utils::system('./configure ' . join(' ', $escapeOptions) . ' >> build.log 2>&1');
$cmd = './configure ' . join(' ', $escapeOptions);
if (!$this->logger->isDebug()) {
$cmd .= " >> {$buildLogPath} 2>&1";
}
Utils::system($cmd, $this->logger);
$this->logger->info("===> Building...");
if ($this->logger->isDebug()) {
passthru('make');
} else {
$make->run($ext);
}
$this->logger->info("===> Installing...");
// This function is disabled when PHP is running in safe mode.
if ($this->logger->isDebug()) {
passthru('make install');
} else {
$make->install($ext);
}
// TODO: use getSharedLibraryPath()
$this->logger->debug("Installed extension library: " . $ext->getSharedLibraryPath());
// Try to find the installed path by pattern
// Installing shared extensions: /Users/c9s/.phpbrew/php/php-5.4.10/lib/php/extensions/debug-non-zts-20100525/
chdir($pwd);
$this->logger->info("===> Extension is installed.");
}