* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: Builder.php 313024 2011-07-06 19:51:24Z dufuz $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*
*/
require_once 'PEAR/Common.php';
require_once 'PEAR/PackageFile.php';
+require_once 'System.php';
/**
* Class to handle building (compiling) extensions.
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version Release: 1.9.4
+ * @version Release: 1.10.1
* @link http://pear.php.net/package/PEAR
* @since Class available since PHP 4.0.2
* @see http://pear.php.net/manual/en/core.ppm.pear-builder.php
*
* @access public
*/
- function PEAR_Builder(&$ui)
+ function __construct(&$ui)
{
- parent::PEAR_Common();
+ parent::__construct();
$this->setFrontendObject($ui);
}
$pkg = $descfile;
$descfile = $pkg->getPackageFile();
} else {
- $pf = &new PEAR_PackageFile($this->config, $this->debug);
+ $pf = new PEAR_PackageFile($this->config, $this->debug);
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($pkg)) {
return $pkg;
*/
function build($descfile, $callback = null)
{
- if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php(.+)?$/',
+ if (preg_match('/(\\/|\\\\|^)([^\\/\\\\]+)?php([^\\/\\\\]+)?$/',
$this->config->get('php_bin'), $matches)) {
if (isset($matches[2]) && strlen($matches[2]) &&
trim($matches[2]) != trim($this->config->get('php_prefix'))) {
$this->addTempFile($dir);
}
} else {
- $pf = &new PEAR_PackageFile($this->config);
+ $pf = new PEAR_PackageFile($this->config);
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($pkg)) {
return $pkg;
// {{{ start of interactive part
$configure_command = "$dir/configure";
+
+ $phpConfigName = $this->config->get('php_prefix')
+ . 'php-config'
+ . $this->config->get('php_suffix');
+ $phpConfigPath = System::which($phpConfigName);
+ if ($phpConfigPath !== false) {
+ $configure_command .= ' --with-php-config='
+ . $phpConfigPath;
+ }
+
$configure_options = $pkg->getConfigureOptions();
if ($configure_options) {
foreach ($configure_options as $o) {
if (!file_exists($build_dir) || !is_dir($build_dir) || !chdir($build_dir)) {
return $this->raiseError("could not chdir to $build_dir");
}
- putenv('PHP_PEAR_VERSION=1.9.4');
+ putenv('PHP_PEAR_VERSION=1.10.1');
foreach ($to_run as $cmd) {
$err = $this->_runCommand($cmd, $callback);
if (PEAR::isError($err)) {
return ($exitcode == 0);
}
- function log($level, $msg)
+ function log($level, $msg, $append_crlf = true)
{
if ($this->current_callback) {
if ($this->debug >= $level) {
}
return;
}
- return PEAR_Common::log($level, $msg);
+ return parent::log($level, $msg, $append_crlf);
}
-}
\ No newline at end of file
+}