Update to PEAR 1.7.2, Image_Canvas 0.3.1, Image_Color 1.0.3, Image_Graph 0.7.2, XML_Parser 1.3.1.

Removed PHP_Compat, and references to it.
Removed ionCube/Zend/mmCache compatibility checks in test.php script.
Changed minimum PHP requirement to 5.0 in test.php script.
This commit is contained in:
anubis
2009-01-04 19:22:54 -05:00
parent 60b674c776
commit fae6352bf2
384 changed files with 34150 additions and 44524 deletions

View File

@@ -14,11 +14,14 @@
* @package PEAR
* @author Stig Bakken <ssb@php.net>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @copyright 1997-2008 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version CVS: $Id: Builder.php,v 1.26 2005/09/27 03:34:01 cellog Exp $
* @version CVS: $Id: Builder.php,v 1.34 2008/05/12 23:43:21 cellog Exp $
* @link http://pear.php.net/package/PEAR
* @since File available since Release 0.1
*
* TODO: log output parameters in PECL command line
* TODO: msdev path in configuration
*/
/**
@@ -33,9 +36,9 @@ require_once 'PEAR/PackageFile.php';
* @package PEAR
* @author Stig Bakken <ssb@php.net>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2005 The PHP Group
* @copyright 1997-2008 The PHP Group
* @license http://www.php.net/license/3_0.txt PHP License 3.0
* @version Release: 1.4.5
* @version Release: 1.7.2
* @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
@@ -50,6 +53,10 @@ class PEAR_Builder extends PEAR_Common
var $extensions_built = array();
/**
* @var string Used for reporting when it is not possible to pass function
* via extra parameter, e.g. log, msdevCallback
*/
var $current_callback = null;
// used for msdev builds
@@ -83,6 +90,7 @@ class PEAR_Builder extends PEAR_Common
{
if (is_object($descfile)) {
$pkg = $descfile;
$descfile = $pkg->getPackageFile();
} else {
$pf = &new PEAR_PackageFile($this->config, $this->debug);
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
@@ -90,22 +98,31 @@ class PEAR_Builder extends PEAR_Common
return $pkg;
}
}
$dir = dirname($pkg->getArchiveFile());
$dir = dirname($descfile);
$old_cwd = getcwd();
if (!@chdir($dir)) {
if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) {
return $this->raiseError("could not chdir to $dir");
}
// packages that were in a .tar have the packagefile in this directory
$vdir = $pkg->getPackage() . '-' . $pkg->getVersion();
if (file_exists($dir) && is_dir($vdir)) {
if (chdir($vdir)) {
$dir = getcwd();
} else {
return $this->raiseError("could not chdir to " . realpath($vdir));
}
}
$this->log(2, "building in $dir");
$dsp = $pkg->getPackage().'.dsp';
if (!@is_file("$dir/$dsp")) {
if (!file_exists("$dir/$dsp")) {
return $this->raiseError("The DSP $dsp does not exist.");
}
// XXX TODO: make release build type configurable
$command = 'msdev '.$dsp.' /MAKE "'.$info['package']. ' - Release"';
$command = 'msdev '.$dsp.' /MAKE "'.$pkg->getPackage(). ' - Release"';
$this->current_callback = $callback;
$err = $this->_runCommand($command, array(&$this, 'msdevCallback'));
if (PEAR::isError($err)) {
return $err;
@@ -147,7 +164,8 @@ class PEAR_Builder extends PEAR_Common
} else {
return $this->raiseError("Could not retrieve output information from $dsp.");
}
if (@copy($outfile, "$dir/$out")) {
// realpath returns false if the file doesn't exist
if ($outfile && copy($outfile, "$dir/$out")) {
$outfile = "$dir/$out";
}
@@ -168,6 +186,7 @@ class PEAR_Builder extends PEAR_Common
if (!$this->_firstline)
$this->_firstline = $data;
$this->_lastline = $data;
call_user_func($this->current_callback, $what, $data);
}
// }}}
@@ -241,6 +260,7 @@ class PEAR_Builder extends PEAR_Common
*/
function build($descfile, $callback = null)
{
$this->current_callback = $callback;
if (PEAR_OS == "Windows") {
return $this->_build_win32($descfile,$callback);
}
@@ -250,16 +270,23 @@ class PEAR_Builder extends PEAR_Common
if (is_object($descfile)) {
$pkg = $descfile;
$descfile = $pkg->getPackageFile();
if (is_a($pkg, 'PEAR_PackageFile_v1')) {
$dir = dirname($descfile);
} else {
$dir = $pkg->_config->get('temp_dir') . '/' . $pkg->getName();
// automatically delete at session end
$this->addTempFile($dir);
}
} else {
$pf = &new PEAR_PackageFile($this->config);
$pkg = &$pf->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL);
if (PEAR::isError($pkg)) {
return $pkg;
}
$dir = dirname($descfile);
}
$dir = dirname($descfile);
$old_cwd = getcwd();
if (!@chdir($dir)) {
if (!file_exists($dir) || !is_dir($dir) || !chdir($dir)) {
return $this->raiseError("could not chdir to $dir");
}
$vdir = $pkg->getPackage() . '-' . $pkg->getVersion();
@@ -268,7 +295,6 @@ class PEAR_Builder extends PEAR_Common
}
$dir = getcwd();
$this->log(2, "building in $dir");
$this->current_callback = $callback;
putenv('PATH=' . $this->config->get('bin_dir') . ':' . getenv('PATH'));
$err = $this->_runCommand("phpize", array(&$this, 'phpizeCallback'));
if (PEAR::isError($err)) {
@@ -283,10 +309,11 @@ class PEAR_Builder extends PEAR_Common
$configure_options = $pkg->getConfigureOptions();
if ($configure_options) {
foreach ($configure_options as $o) {
$default = array_key_exists('default', $o) ? $o['default'] : null;
list($r) = $this->ui->userDialog('build',
array($o['prompt']),
array('text'),
array(@$o['default']));
array($default));
if (substr($o['name'], 0, 5) == 'with-' &&
($r == 'yes' || $r == 'autodetect')) {
$configure_command .= " --$o[name]";
@@ -326,12 +353,12 @@ class PEAR_Builder extends PEAR_Common
$configure_command,
$make_command,
"$make_command INSTALL_ROOT=\"$inst_dir\" install",
"find \"$inst_dir\" -ls"
"find \"$inst_dir\" | xargs ls -dils"
);
if (!@chdir($build_dir)) {
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.4.5');
putenv('PHP_PEAR_VERSION=1.7.2');
foreach ($to_run as $cmd) {
$err = $this->_runCommand($cmd, $callback);
if (PEAR::isError($err)) {
@@ -412,7 +439,7 @@ class PEAR_Builder extends PEAR_Common
function _runCommand($command, $callback = null)
{
$this->log(1, "running: $command");
$pp = @popen("$command 2>&1", "r");
$pp = popen("$command 2>&1", "r");
if (!$pp) {
return $this->raiseError("failed to run `$command'");
}
@@ -431,7 +458,11 @@ class PEAR_Builder extends PEAR_Common
if ($callback && isset($olddbg)) {
$callback[0]->debug = $olddbg;
}
$exitcode = @pclose($pp);
if (is_resource($pp)) {
$exitcode = pclose($pp);
} else {
$exitcode = -1;
}
return ($exitcode == 0);
}