summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2003-10-20 15:51:46 +0000
committerTomas V.V.Cox <cox@php.net>2003-10-20 15:51:46 +0000
commitafd54937070071ef28ce601c1dd82b6342fad8b5 (patch)
tree751d269ed9d52f73e9f2ae02460b9c787fd1b5a3
parent7df5e203c671b95a340daeb405513f8498ce2119 (diff)
downloadphp-git-afd54937070071ef28ce601c1dd82b6342fad8b5.tar.gz
MFH for 4.3.4RC2
-rw-r--r--pear/PEAR.php1
-rw-r--r--pear/PEAR/Autoloader.php19
-rw-r--r--pear/PEAR/Builder.php6
-rw-r--r--pear/PEAR/Command.php30
-rw-r--r--pear/PEAR/Command/Remote.php31
-rw-r--r--pear/PEAR/Common.php35
-rw-r--r--pear/PEAR/Dependency.php39
-rw-r--r--pear/PEAR/Frontend/CLI.php4
-rw-r--r--pear/PEAR/Installer.php214
-rw-r--r--pear/PEAR/Packager.php75
-rw-r--r--pear/PEAR/Remote.php6
-rw-r--r--pear/System.php16
-rw-r--r--pear/package-PEAR.xml50
-rwxr-xr-xpear/scripts/pear.bat120
14 files changed, 402 insertions, 244 deletions
diff --git a/pear/PEAR.php b/pear/PEAR.php
index da40082604..ef683a876f 100644
--- a/pear/PEAR.php
+++ b/pear/PEAR.php
@@ -490,6 +490,7 @@ class PEAR
$code = $message->getCode();
$userinfo = $message->getUserInfo();
$error_class = $message->getType();
+ $message->error_message_prefix = '';
$message = $message->getMessage();
}
diff --git a/pear/PEAR/Autoloader.php b/pear/PEAR/Autoloader.php
index f211a184e5..5bd78a9990 100644
--- a/pear/PEAR/Autoloader.php
+++ b/pear/PEAR/Autoloader.php
@@ -42,6 +42,8 @@ require_once "PEAR.php";
*/
class PEAR_Autoloader extends PEAR
{
+ // {{{ properties
+
/**
* Map of methods and classes where they are defined
*
@@ -60,6 +62,9 @@ class PEAR_Autoloader extends PEAR
*/
var $_method_map = array();
+ // }}}
+ // {{{ addAutoload()
+
/**
* Add one or more autoload entries.
*
@@ -85,6 +90,9 @@ class PEAR_Autoloader extends PEAR
}
}
+ // }}}
+ // {{{ removeAutoload()
+
/**
* Remove an autoload entry.
*
@@ -101,6 +109,9 @@ class PEAR_Autoloader extends PEAR
return $ok;
}
+ // }}}
+ // {{{ addAggregateObject()
+
/**
* Add an aggregate object to this object. If the specified class
* is not defined, loading it will be attempted following PEAR's
@@ -131,6 +142,9 @@ class PEAR_Autoloader extends PEAR
}
}
+ // }}}
+ // {{{ removeAggregateObject()
+
/**
* Remove an aggregate object.
*
@@ -154,6 +168,9 @@ class PEAR_Autoloader extends PEAR
return $ok;
}
+ // }}}
+ // {{{ __call()
+
/**
* Overloaded object call handler, called each time an
* undefined/aggregated method is invoked. This method repeats
@@ -179,6 +196,8 @@ class PEAR_Autoloader extends PEAR
}
return false;
}
+
+ // }}}
}
overload("PEAR_Autoloader");
diff --git a/pear/PEAR/Builder.php b/pear/PEAR/Builder.php
index 13c3f36f60..69ba653292 100644
--- a/pear/PEAR/Builder.php
+++ b/pear/PEAR/Builder.php
@@ -206,7 +206,7 @@ class PEAR_Builder extends PEAR_Common
return $this->raiseError("`phpize' failed");
}
- // start of interactive part
+ // {{{ start of interactive part
$configure_command = "$dir/configure";
if (isset($info['configure_options'])) {
foreach ($info['configure_options'] as $o) {
@@ -222,9 +222,9 @@ class PEAR_Builder extends PEAR_Common
}
}
}
- // end of interactive part
+ // }}} end of interactive part
- // make configurable
+ // FIXME make configurable
if(!$user=getenv('USER')){
$user='defaultuser';
}
diff --git a/pear/PEAR/Command.php b/pear/PEAR/Command.php
index 543032715d..869ba802c1 100644
--- a/pear/PEAR/Command.php
+++ b/pear/PEAR/Command.php
@@ -96,6 +96,8 @@ $GLOBALS['_PEAR_Command_uiobject'] = null;
*/
class PEAR_Command
{
+ // {{{ factory()
+
/**
* Get the right object for executing a command.
*
@@ -123,6 +125,9 @@ class PEAR_Command
return $obj;
}
+ // }}}
+ // {{{ & getFrontendObject()
+
/**
* Get instance of frontend object.
*
@@ -136,6 +141,9 @@ class PEAR_Command
return $GLOBALS['_PEAR_Command_uiobject'];
}
+ // }}}
+ // {{{ & setFrontendClass()
+
/**
* Load current frontend class.
*
@@ -166,6 +174,9 @@ class PEAR_Command
return PEAR::raiseError("no such class: $uiclass");
}
+ // }}}
+ // {{{ setFrontendType()
+
/**
* Set current frontend.
*
@@ -179,6 +190,9 @@ class PEAR_Command
return PEAR_Command::setFrontendClass($uiclass);
}
+ // }}}
+ // {{{ registerCommands()
+
/**
* Scan through the Command directory looking for classes
* and see what commands they implement.
@@ -232,6 +246,9 @@ class PEAR_Command
return true;
}
+ // }}}
+ // {{{ getCommands()
+
/**
* Get the list of currently supported commands, and what
* classes implement them.
@@ -248,6 +265,9 @@ class PEAR_Command
return $GLOBALS['_PEAR_Command_commandlist'];
}
+ // }}}
+ // {{{ getShortcuts()
+
/**
* Get the list of command shortcuts.
*
@@ -263,6 +283,9 @@ class PEAR_Command
return $GLOBALS['_PEAR_Command_shortcuts'];
}
+ // }}}
+ // {{{ getGetoptArgs()
+
/**
* Compiles arguments for getopt.
*
@@ -287,6 +310,9 @@ class PEAR_Command
return $obj->getGetoptArgs($command, $short_args, $long_args);
}
+ // }}}
+ // {{{ getDescription()
+
/**
* Get description for a command.
*
@@ -301,6 +327,9 @@ class PEAR_Command
return @$GLOBALS['_PEAR_Command_commanddesc'][$command];
}
+ // }}}
+ // {{{ getHelp()
+
/**
* Get help for command.
*
@@ -317,6 +346,7 @@ class PEAR_Command
}
return false;
}
+ // }}}
}
?>
diff --git a/pear/PEAR/Command/Remote.php b/pear/PEAR/Command/Remote.php
index 205b3dd8b6..0235b4c85a 100644
--- a/pear/PEAR/Command/Remote.php
+++ b/pear/PEAR/Command/Remote.php
@@ -188,7 +188,8 @@ parameter.
'border' => true,
'headline' => array('Package', 'Latest', 'Local'),
);
-
+ $local_pkgs = $reg->listPackages();
+
foreach ($available as $name => $info) {
$installed = $reg->packageInfo($name);
$desc = $info['summary'];
@@ -205,8 +206,12 @@ parameter.
&& (!isset($installed['version']) || $installed['version'] == $info['stable']))
{
continue;
- };
- };
+ }
+ }
+ $pos = array_search(strtolower($name), $local_pkgs);
+ if ($pos !== false) {
+ unset($local_pkgs[$pos]);
+ }
$data['data'][$info['category']][] = array(
$name,
@@ -216,6 +221,18 @@ parameter.
@$info['deps'],
);
}
+
+ foreach ($local_pkgs as $name) {
+ $info = $reg->packageInfo($name);
+ $data['data']['Local'][] = array(
+ $info['package'],
+ '',
+ $info['version'],
+ $info['summary'],
+ @$info['release_deps']
+ );
+ }
+
$this->ui->outputData($data, $command);
return true;
}
@@ -322,7 +339,7 @@ parameter.
$latest = $remote->call("package.listLatestReleases");
} else {
$latest = $remote->call("package.listLatestReleases", $state);
- $caption .= ' (' . $state . ')';
+ $caption .= ' (' . implode(', ', PEAR_Common::betterStates($state, true)) . ')';
}
$caption .= ':';
if (PEAR::isError($latest)) {
@@ -342,7 +359,9 @@ parameter.
continue;
}
extract($info);
- $inst_version = $reg->packageInfo($package, 'version');
+ $pkginfo = $reg->packageInfo($package);
+ $inst_version = $pkginfo['version'];
+ $inst_state = $pkginfo['release_state'];
if (version_compare("$version", "$inst_version", "le")) {
// installed version is up-to-date
continue;
@@ -356,7 +375,7 @@ parameter.
} else {
$fs = " -"; // XXX center instead
}
- $data['data'][] = array($pkg, $inst_version, $version, $fs);
+ $data['data'][] = array($pkg, "$inst_version ($inst_state)", "$version ($state)", $fs);
}
if (empty($data['data'])) {
$this->ui->outputData('No upgrades available');
diff --git a/pear/PEAR/Common.php b/pear/PEAR/Common.php
index e4cfa7515f..478ca11c16 100644
--- a/pear/PEAR/Common.php
+++ b/pear/PEAR/Common.php
@@ -26,10 +26,15 @@ require_once 'PEAR/Config.php';
// {{{ constants and globals
-define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^[A-Za-z][a-zA-Z0-9_]+$/');
+define('_PEAR_COMMON_PACKAGE_NAME_PREG', '[A-Za-z][a-zA-Z0-9_]+');
+define('PEAR_COMMON_PACKAGE_NAME_PREG', '/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '$/');
+
+// this should allow: 1, 1.0, 1.0RC1, 1.0dev, 1.0dev123234234234, 1.0a1, 1.0b1, 1.0pl1
+define('_PEAR_COMMON_PACKAGE_VERSION_PREG', '\d+(?:\.\d+)*(?:[a-z]+\d*)?');
+define('PEAR_COMMON_PACKAGE_VERSION_PREG', '/^' . _PEAR_COMMON_PACKAGE_VERSION_PREG . '$/i');
// XXX far from perfect :-)
-define('PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '/^([A-Za-z][a-zA-Z0-9_]+)(-([.0-9a-zA-Z]+))?$/');
+define('PEAR_COMMON_PACKAGE_DOWNLOAD_PREG', '/^(' . _PEAR_COMMON_PACKAGE_NAME_PREG . ')(-([.0-9a-zA-Z]+))?$/');
/**
* List of temporary files and directories registered by
@@ -1036,8 +1041,10 @@ class PEAR_Common extends PEAR
}
$errors = array();
$warnings = array();
- if (empty($info['package'])) {
+ if (!isset($info['package'])) {
$errors[] = 'missing package name';
+ } elseif (!$this->validPackageName($info['package'])) {
+ $errors[] = 'invalid package name';
}
if (empty($info['summary'])) {
$errors[] = 'missing summary';
@@ -1050,8 +1057,10 @@ class PEAR_Common extends PEAR
if (empty($info['release_license'])) {
$errors[] = 'missing license';
}
- if (empty($info['version'])) {
+ if (!isset($info['version'])) {
$errors[] = 'missing version';
+ } elseif (!$this->validPackageVersion($info['version'])) {
+ $errors[] = 'invalid package version';
}
if (empty($info['release_state'])) {
$errors[] = 'missing release state';
@@ -1556,6 +1565,24 @@ class PEAR_Common extends PEAR
// }}}
+ // {{{ validPackageVersion()
+
+ /**
+ * Test whether a string contains a valid package version.
+ *
+ * @param string $ver the package version to test
+ *
+ * @return bool
+ *
+ * @access public
+ */
+ function validPackageVersion($ver)
+ {
+ return (bool)preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver);
+ }
+
+
+ // }}}
// {{{ downloadHttp()
diff --git a/pear/PEAR/Dependency.php b/pear/PEAR/Dependency.php
index 3aca0ebc7e..6aee05f69e 100644
--- a/pear/PEAR/Dependency.php
+++ b/pear/PEAR/Dependency.php
@@ -39,6 +39,7 @@ define('PEAR_DEPENDENCY_MISSING_OPTIONAL', -6);
*/
class PEAR_Dependency
{
+ // {{{ constructor
/**
* Constructor
*
@@ -51,6 +52,9 @@ class PEAR_Dependency
$this->registry = &$registry;
}
+ // }}}
+ // {{{ callCheckMethod()
+
/**
* This method maps the XML dependency definition to the
* corresponding one from PEAR_Dependency
@@ -105,6 +109,9 @@ class PEAR_Dependency
}
}
+ // }}}
+ // {{{ checkPackage()
+
/**
* Package dependencies check method
*
@@ -163,6 +170,9 @@ class PEAR_Dependency
return PEAR_DEPENDENCY_BAD_DEPENDENCY;
}
+ // }}}
+ // {{{ checkPackageUninstall()
+
/**
* Check package dependencies on uninstall
*
@@ -189,14 +199,17 @@ class PEAR_Dependency
if (isset($dep['optional']) && $dep['optional'] == 'yes') {
$warning .= "\nWarning: Package '$pkg' optionally depends on '$package'";
} else {
- $error .= "Package '$pkg' depends on '$package'\n";
+ $error .= "Package '$pkg' depends on '$package'\n";
+ }
}
}
}
- }
return ($error) ? true : false;
}
+ // }}}
+ // {{{ checkExtension()
+
/**
* Extension dependencies check method
*
@@ -241,6 +254,9 @@ class PEAR_Dependency
return $code;
}
+ // }}}
+ // {{{ checkOS()
+
/**
* Operating system dependencies check method
*
@@ -265,6 +281,9 @@ class PEAR_Dependency
return PEAR_DEPENDENCY_CONFLICT;
}
+ // }}}
+ // {{{ checkPHP()
+
/**
* PHP version check method
*
@@ -288,6 +307,9 @@ class PEAR_Dependency
return false;
}
+ // }}}
+ // {{{ checkProgram()
+
/**
* External program check method. Looks for executable files in
* directories listed in the PATH environment variable.
@@ -312,6 +334,9 @@ class PEAR_Dependency
return PEAR_DEPENDENCY_MISSING;
}
+ // }}}
+ // {{{ checkSAPI()
+
/**
* SAPI backend check method. Version comparison is not yet
* available here.
@@ -337,6 +362,8 @@ class PEAR_Dependency
return PEAR_DEPENDENCY_CONFLICT;
}
+ // }}}
+ // {{{ checkZend()
/**
* Zend version check method
@@ -361,6 +388,9 @@ class PEAR_Dependency
return false;
}
+ // }}}
+ // {{{ signOperator()
+
/**
* Converts text comparing operators to them sign equivalents
*
@@ -384,6 +414,9 @@ class PEAR_Dependency
}
}
+ // }}}
+ // {{{ codeFromRelation()
+
/**
* Convert relation into corresponding code
*
@@ -413,5 +446,7 @@ class PEAR_Dependency
}
return $code;
}
+
+ // }}}
}
?>
diff --git a/pear/PEAR/Frontend/CLI.php b/pear/PEAR/Frontend/CLI.php
index a5cb8f2649..7604077d46 100644
--- a/pear/PEAR/Frontend/CLI.php
+++ b/pear/PEAR/Frontend/CLI.php
@@ -475,8 +475,8 @@ class PEAR_Frontend_CLI extends PEAR
function log($text, $append_crlf = true)
{
if ($append_crlf) {
- return $this->_displayLine($text);
- }
+ return $this->_displayLine($text);
+ }
return $this->_display($text);
}
diff --git a/pear/PEAR/Installer.php b/pear/PEAR/Installer.php
index dc7373cc36..184cc25727 100644
--- a/pear/PEAR/Installer.php
+++ b/pear/PEAR/Installer.php
@@ -165,19 +165,21 @@ class PEAR_Installer extends PEAR_Common
*/
function _installFile($file, $atts, $tmp_path, $options)
{
+ // {{{ return if this file is meant for another platform
static $os;
if (isset($atts['platform'])) {
if (empty($os)) {
include_once "OS/Guess.php";
$os = new OS_Guess();
}
- // return if this file is meant for another platform
if (!$os->matchSignature($atts['platform'])) {
$this->log(3, "skipped $file (meant for $atts[platform], we are ".$os->getSignature().")");
return PEAR_INSTALLER_SKIPPED;
}
}
+ // }}}
+ // {{{ assemble the destination paths
switch ($atts['role']) {
case 'doc':
case 'data':
@@ -223,6 +225,8 @@ class PEAR_Installer extends PEAR_Common
$final_dest_file = $this->_prependPath($dest_file, $this->installroot);
$dest_dir = dirname($final_dest_file);
$dest_file = $dest_dir . DIRECTORY_SEPARATOR . '.tmp' . basename($final_dest_file);
+ // }}}
+
if (!@is_dir($dest_dir)) {
if (!$this->mkDirHier($dest_dir)) {
return $this->raiseError("failed to mkdir $dest_dir",
@@ -244,6 +248,7 @@ class PEAR_Installer extends PEAR_Common
$md5sum = md5_file($dest_file);
}
} else {
+ // {{{ file with replacements
if (!file_exists($orig_file)) {
return $this->raiseError("file does not exist",
PEAR_INSTALLER_FAILED);
@@ -297,7 +302,9 @@ class PEAR_Installer extends PEAR_Common
PEAR_INSTALLER_FAILED);
}
fclose($wp);
+ // }}}
}
+ // {{{ check the md5
if (isset($md5sum)) {
if (strtolower($md5sum) == strtolower($atts['md5sum'])) {
$this->log(2, "md5sum ok: $final_dest_file");
@@ -312,6 +319,8 @@ class PEAR_Installer extends PEAR_Common
}
}
}
+ // }}}
+ // {{{ set file permissions
if (!OS_WINDOWS) {
if ($atts['role'] == 'script') {
$mode = 0777 & ~(int)octdec($this->config->get('umask'));
@@ -324,6 +333,7 @@ class PEAR_Installer extends PEAR_Common
$this->log(0, "failed to change mode of $dest_file");
}
}
+ // }}}
$this->addFileOperation("rename", array($dest_file, $final_dest_file));
// Store the full path where the file was installed for easy unistall
$this->addFileOperation("installed_as", array($file, $installed_as,
@@ -391,7 +401,7 @@ class PEAR_Installer extends PEAR_Common
{
$n = count($this->file_operations);
$this->log(2, "about to commit $n file operations");
- // first, check permissions and such manually
+ // {{{ first, check permissions and such manually
$errors = array();
foreach ($this->file_operations as $tr) {
list($type, $data) = $tr;
@@ -423,6 +433,7 @@ class PEAR_Installer extends PEAR_Common
}
}
+ // }}}
$m = sizeof($errors);
if ($m > 0) {
foreach ($errors as $error) {
@@ -430,7 +441,7 @@ class PEAR_Installer extends PEAR_Common
}
return false;
}
- // really commit the transaction
+ // {{{ really commit the transaction
foreach ($this->file_operations as $tr) {
list($type, $data) = $tr;
switch ($type) {
@@ -466,6 +477,7 @@ class PEAR_Installer extends PEAR_Common
break;
}
}
+ // }}}
$this->log(2, "successfully committed $n file operations");
$this->file_operations = array();
return true;
@@ -559,7 +571,7 @@ class PEAR_Installer extends PEAR_Common
}
// }}}
- // {{ extractDownloadFileName($pkgfile, &$version)
+ // {{{ extractDownloadFileName($pkgfile, &$version)
function extractDownloadFileName($pkgfile, &$version)
{
@@ -591,6 +603,7 @@ class PEAR_Installer extends PEAR_Common
function _downloadFile($pkgfile, &$config, $options, &$errors, $version,
$origpkgfile, $state)
{
+ // {{{ check the package filename, and whether it's already installed
$need_download = false;
if (preg_match('#^(http|ftp)://#', $pkgfile)) {
$need_download = true;
@@ -613,8 +626,9 @@ class PEAR_Installer extends PEAR_Common
return;
}
}
+ // }}}
- // Download package -----------------------------------------------
+ // {{{ Download package -----------------------------------------------
if ($need_download) {
$downloaddir = $config->get('download_dir');
if (empty($downloaddir)) {
@@ -652,6 +666,7 @@ class PEAR_Installer extends PEAR_Common
}
$pkgfile = $file;
}
+ // }}}
return $pkgfile;
}
@@ -684,6 +699,7 @@ class PEAR_Installer extends PEAR_Common
// - onlyreqdeps : install all required dependencies as well
// - alldeps : install all dependencies, including optional
//
+ // {{{ determine preferred state, installroot, etc
if (!$willinstall) {
$willinstall = array();
}
@@ -705,56 +721,87 @@ class PEAR_Installer extends PEAR_Common
} else {
$this->installroot = '';
}
+ // }}}
$this->registry = &new PEAR_Registry($php_dir);
- // download files in this list if necessary
+ // {{{ download files in this list if necessary
foreach($packages as $pkgfile) {
if (!is_file($pkgfile)) {
$origpkgfile = $pkgfile;
$pkgfile = $this->extractDownloadFileName($pkgfile, $version);
- if ($this->validPackageName($pkgfile)) {
- if ($this->registry->packageExists($pkgfile)
- && !isset($options['upgrade'])) {
- $this->log(0, "Package '$pkgfile' already installed, skipping");
- // ignore dependencies that are installed unless we are upgrading
- continue;
- }
- if ($version === null) {
- // use preferred state if no version number was specified
- include_once 'PEAR/Remote.php';
- $curver = $this->registry->packageInfo($pkgfile, 'version');
- $remote = &new PEAR_Remote($config);
- $releases = $remote->call('package.info', $pkgfile, 'releases');
- $states = $this->betterStates($state, true);
- $possible = false;
- foreach($releases as $ver => $inf) {
- if (in_array($inf['state'], $states)) {
- if (is_array($possible)) {
- if (version_compare(key($possible), $ver) < 0) {
- $possible = array($ver => $inf['state']);
- }
- } else {
- if (version_compare($ver, $curver) > 0) {
- $possible = array($ver => $inf['state']);
- }
- }
+ if (!$this->validPackageName($pkgfile)) {
+ return $this->raiseError("Package name '$pkgfile' not valid");
+ }
+ // ignore packages that are installed unless we are upgrading
+ $curinfo = $this->registry->packageInfo($pkgfile);
+ if ($this->registry->packageExists($pkgfile) && empty($options['upgrade']) && empty($options['force'])) {
+ $this->log(0, "Package '{$curinfo['package']}' already installed, skipping");
+ continue;
+ }
+ // Retrieve remote release list
+ include_once 'PEAR/Remote.php';
+ $curver = $curinfo['version'];
+ $remote = &new PEAR_Remote($config);
+ $releases = $remote->call('package.info', $pkgfile, 'releases');
+ if (!count($releases)) {
+ return $this->raiseError("No releases found for package '$pkgfile'");
+ }
+ // Want a specific version/state
+ if ($version !== null) {
+ // Passed Foo-1.2
+ if ($this->validPackageVersion($version)) {
+ if (!isset($releases[$version])) {
+ return $this->raiseError("No release with version '$version' found for '$pkgfile'");
+ }
+ // Passed Foo-alpha
+ } elseif (in_array($version, $this->getReleaseStates())) {
+ $state = $version;
+ $version = 0;
+ foreach ($releases as $ver => $inf) {
+ if ($inf['state'] == $state && version_compare("$version", "$ver") < 0) {
+ $version = $ver;
}
}
- if ($possible) {
- $pkgfile = $this->_downloadFile($pkgfile, $config, $options,
- $errors, key($possible), $origpkgfile,
- $state);
+ if ($version == 0) {
+ return $this->raiseError("No release with state '$state' found for '$pkgfile'");
}
+ // invalid postfix passed
} else {
- $pkgfile = $this->_downloadFile($pkgfile, $config, $options,
- $errors, $version, $origpkgfile,
- $state);
- if (PEAR::isError($pkgfile)) {
- return $pkgfile;
+ return $this->raiseError("Invalid postfix '-$version', be sure to pass a valid PEAR ".
+ "version number or release state");
+ }
+ // Guess what to download
+ } else {
+ $states = $this->betterStates($state, true);
+ $possible = false;
+ $version = 0;
+ foreach ($releases as $ver => $inf) {
+ if (in_array($inf['state'], $states) && version_compare("$version", "$ver") < 0) {
+ $version = $ver;
}
}
+ if ($version == 0) {
+ return $this->raiseError('No release with state equal to: \'' . implode(', ', $states) .
+ "' found for '$pkgfile'");
+ }
}
- }
+ // Check if we haven't already the version
+ if (empty($options['force'])) {
+ if ($curinfo['version'] == $version) {
+ $this->log(0, "Package '{$curinfo['package']}-{$curinfo['version']}' already installed, skipping");
+ continue;
+ } elseif (version_compare("$version", "{$curinfo['version']}") < 0) {
+ $this->log(0, "Already got '{$curinfo['package']}-{$curinfo['version']}' greater than requested '$version', skipping");
+ continue;
+ }
+ }
+ $pkgfile = $this->_downloadFile($pkgfile, $config, $options,
+ $errors, $version, $origpkgfile,
+ $state);
+ if (PEAR::isError($pkgfile)) {
+ return $pkgfile;
+ }
+ } // end is_file()
$tempinfo = $this->infoFromAny($pkgfile);
if (isset($options['alldeps']) || isset($options['onlyreqdeps'])) {
// ignore dependencies if there are any errors
@@ -764,10 +811,11 @@ class PEAR_Installer extends PEAR_Common
}
$installpackages[] = array('pkg' => $tempinfo['package'],
'file' => $pkgfile, 'info' => $tempinfo);
- }
+ } // end foreach($packages)
+ // }}}
- // extract dependencies from downloaded files and then download them
- // if necessary
+ // {{{ extract dependencies from downloaded files and then download
+ // them if necessary
if (isset($options['alldeps']) || isset($options['onlyreqdeps'])) {
include_once "PEAR/Remote.php";
$remote = new PEAR_Remote($config);
@@ -777,7 +825,7 @@ class PEAR_Installer extends PEAR_Common
$installed = array_flip($installed);
}
$deppackages = array();
- // construct the list of dependencies for each file
+ // {{{ construct the list of dependencies for each file
foreach ($mywillinstall as $package => $alldeps) {
if (!is_array($alldeps)) {
continue;
@@ -792,7 +840,7 @@ class PEAR_Installer extends PEAR_Common
$this->log(0, "skipping Package $package optional dependency $info[name]");
continue;
}
- // get releases
+ // {{{ get releases
$releases = $remote->call('package.info', $info['name'], 'releases');
if (PEAR::isError($releases)) {
return $releases;
@@ -800,7 +848,7 @@ class PEAR_Installer extends PEAR_Common
if (!count($releases)) {
if (!isset($installed[strtolower($info['name'])])) {
$errors[] = "Package $package dependency $info[name] ".
- "has no releases";
+ "has no releases";
}
continue;
}
@@ -810,8 +858,8 @@ class PEAR_Installer extends PEAR_Common
if (!empty($state) && $state != 'any') {
list($release_version,$release) = each($releases);
if ($state != $release['state'] &&
- !in_array($release['state'],
- $this->betterStates($state))) {
+ !in_array($release['state'], $this->betterStates($state)))
+ {
// drop this release - it ain't stable enough
array_shift($releases);
} else {
@@ -842,8 +890,9 @@ class PEAR_Installer extends PEAR_Common
$deppackages[] = $info['name'];
continue;
}
+ // }}}
- // see if a dependency must be upgraded
+ // {{{ see if a dependency must be upgraded
$inst_version = $this->registry->packageInfo($info['name'], 'version');
if (!isset($info['version'])) {
// this is a rel='has' dependency, check against latest
@@ -859,8 +908,10 @@ class PEAR_Installer extends PEAR_Common
continue;
}
$deppackages[] = $info['name'];
+ // }}}
} // foreach($alldeps
- } // foreach($willinstall
+ }
+ // }}} foreach($willinstall
if (count($deppackages)) {
// check dependencies' dependencies
@@ -874,9 +925,9 @@ class PEAR_Installer extends PEAR_Common
}
$willinstall = array_merge($willinstall, $temppack);
$this->download($deppackages, $options, $config, $installpackages,
- $errors, $installed, $willinstall, $state);
+ $errors, $installed, $willinstall, $state);
}
- } // if --alldeps or --onlyreqdeps
+ } // }}} if --alldeps or --onlyreqdeps
}
// }}}
@@ -919,14 +970,10 @@ class PEAR_Installer extends PEAR_Common
if (substr($pkgfile, -4) == '.xml') {
$descfile = $pkgfile;
} else {
- // Decompress pack in tmp dir -------------------------------------
+ // {{{ Decompress pack in tmp dir -------------------------------------
// To allow relative package file names
- $oldcwd = getcwd();
- if (@chdir(dirname($pkgfile))) {
- $pkgfile = getcwd() . DIRECTORY_SEPARATOR . basename($pkgfile);
- chdir($oldcwd);
- }
+ $pkgfile = realpath($pkgfile);
if (PEAR::isError($tmpdir = System::mktemp('-d'))) {
return $tmpdir;
@@ -938,7 +985,7 @@ class PEAR_Installer extends PEAR_Common
return $this->raiseError("unable to unpack $pkgfile");
}
- // ----- Look for existing package file
+ // {{{ Look for existing package file
$descfile = $tmpdir . DIRECTORY_SEPARATOR . 'package.xml';
if (!is_file($descfile)) {
@@ -954,7 +1001,9 @@ class PEAR_Installer extends PEAR_Common
$flag_old_format = true;
$this->log(0, "warning : you are using an archive with an old format");
}
+ // }}}
// <== XXX This part should be removed later on
+ // }}}
}
if (!is_file($descfile)) {
@@ -980,7 +1029,7 @@ class PEAR_Installer extends PEAR_Common
$pkgname = $pkginfo['package'];
- // Check dependencies -------------------------------------------
+ // {{{ Check dependencies -------------------------------------------
if (isset($pkginfo['release_deps']) && empty($options['nodeps'])) {
$dep_errors = '';
$error = $this->checkDeps($pkginfo, $dep_errors);
@@ -996,9 +1045,10 @@ class PEAR_Installer extends PEAR_Common
}
}
}
+ // }}}
+ // {{{ checks to do when not in "force" mode
if (empty($options['force'])) {
- // checks to do when not in "force" mode
$test = $this->registry->checkFileMap($pkginfo);
if (sizeof($test)) {
$tmp = $test;
@@ -1018,6 +1068,7 @@ class PEAR_Installer extends PEAR_Common
}
}
}
+ // }}}
$this->startFileTransaction();
@@ -1027,10 +1078,6 @@ class PEAR_Installer extends PEAR_Common
return $this->raiseError("$pkgname already installed");
}
} else {
- // checks to do only when upgrading packages
-/* if (!$this->registry->packageExists($pkgname)) {
- return $this->raiseError("$pkgname not installed");
- }*/
if ($this->registry->packageExists($pkgname)) {
$v1 = $this->registry->packageInfo($pkgname, 'version');
$v2 = $pkginfo['version'];
@@ -1047,7 +1094,7 @@ class PEAR_Installer extends PEAR_Common
}
}
- // Copy files to dest dir ---------------------------------------
+ // {{{ Copy files to dest dir ---------------------------------------
// info from the package it self we want to access from _installFile
$this->pkginfo = &$pkginfo;
@@ -1060,12 +1107,9 @@ class PEAR_Installer extends PEAR_Common
null, PEAR_ERROR_DIE);
}
- // don't want strange characters
- $pkgname = ereg_replace ('[^a-zA-Z0-9._]', '_', $pkginfo['package']);
- $pkgversion = ereg_replace ('[^a-zA-Z0-9._\-]', '_', $pkginfo['version']);
$tmp_path = dirname($descfile);
if (substr($pkgfile, -4) != '.xml') {
- $tmp_path .= DIRECTORY_SEPARATOR . $pkgname . '-' . $pkgversion;
+ $tmp_path .= DIRECTORY_SEPARATOR . $pkgname . '-' . $pkginfo['version'];
}
// ==> XXX This part should be removed later on
@@ -1074,6 +1118,7 @@ class PEAR_Installer extends PEAR_Common
}
// <== XXX This part should be removed later on
+ // {{{ install files
foreach ($pkginfo['filelist'] as $file => $atts) {
$this->expectError(PEAR_INSTALLER_FAILED);
$res = $this->_installFile($file, $atts, $tmp_path, $options);
@@ -1094,7 +1139,9 @@ class PEAR_Installer extends PEAR_Common
unset($pkginfo['filelist'][$file]);
}
}
+ // }}}
+ // {{{ compile and install source files
if ($this->source_files > 0 && empty($options['nobuild'])) {
$this->log(1, "$this->source_files source files, building");
$bob = &new PEAR_Builder($this->ui);
@@ -1107,6 +1154,11 @@ class PEAR_Installer extends PEAR_Common
$this->log(1, "\nBuild process completed successfully");
foreach ($built as $ext) {
$bn = basename($ext['file']);
+ list($_ext_name, ) = explode('.', $bn);
+ if (extension_loaded($_ext_name)) {
+ $this->raiseError("Extension '$_ext_name' already loaded. Please unload it ".
+ "in your php.ini file prior to install or upgrade it.");
+ }
$dest = $this->config->get('ext_dir') . DIRECTORY_SEPARATOR . $bn;
$this->log(1, "Installing '$bn' at ext_dir ($dest)");
$this->log(3, "+ cp $ext[file] ext_dir ($dest)");
@@ -1124,15 +1176,17 @@ class PEAR_Installer extends PEAR_Common
);
}
}
+ // }}}
}
if (!$this->commitFileTransaction()) {
$this->rollbackFileTransaction();
return $this->raiseError("commit failed", PEAR_INSTALLER_FAILED);
}
+ // }}}
$ret = false;
- // Register that the package is installed -----------------------
+ // {{{ Register that the package is installed -----------------------
if (empty($options['upgrade'])) {
// if 'force' is used, replace the info in registry
if (!empty($options['force']) && $this->registry->packageExists($pkgname)) {
@@ -1144,12 +1198,13 @@ class PEAR_Installer extends PEAR_Common
if (!$this->registry->packageExists($pkgname)) {
$ret = $this->registry->addPackage($pkgname, $pkginfo);
} else {
- $ret = $this->registry->updatePackage($pkgname, $pkginfo, false);
- }
+ $ret = $this->registry->updatePackage($pkgname, $pkginfo, false);
+ }
}
if (!$ret) {
return $this->raiseError("Adding package $pkgname to registry failed");
}
+ // }}}
return $pkginfo;
}
@@ -1193,8 +1248,8 @@ class PEAR_Installer extends PEAR_Common
$this->log(0, $warning);
}
}
+ // {{{ Delete the files
$this->startFileTransaction();
- // Delete the files
if (PEAR::isError($err = $this->_deletePackageFiles($package))) {
$this->rollbackFileTransaction();
return $this->raiseError($err);
@@ -1216,6 +1271,7 @@ class PEAR_Installer extends PEAR_Common
$this->rollbackFileTransaction();
}
}
+ // }}}
// Register that the package is no longer installed
return $this->registry->deletePackage($package);
@@ -1264,6 +1320,7 @@ class PEAR_Installer extends PEAR_Common
}
}
}
+ // {{{ failed dependencies
$n = count($failed_deps);
if ($n > 0) {
for ($i = 0; $i < $n; $i++) {
@@ -1292,7 +1349,9 @@ class PEAR_Installer extends PEAR_Common
}
return true;
}
+ // }}}
+ // {{{ optional dependencies
$count_optional = count($optional_deps);
if ($count_optional > 0) {
$errors = "Optional dependencies:";
@@ -1313,6 +1372,7 @@ class PEAR_Installer extends PEAR_Common
}
return false;
}
+ // }}}
}
return false;
}
@@ -1361,6 +1421,7 @@ class PEAR_Installer extends PEAR_Common
// }}}
}
+// {{{ md5_file() utility function
if (!function_exists("md5_file")) {
function md5_file($filename) {
$fp = fopen($filename, "r");
@@ -1370,5 +1431,6 @@ if (!function_exists("md5_file")) {
return md5($contents);
}
}
+// }}}
?>
diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php
index 1bf1b76436..c0f5ca0c60 100644
--- a/pear/PEAR/Packager.php
+++ b/pear/PEAR/Packager.php
@@ -54,34 +54,21 @@ class PEAR_Packager extends PEAR_Common
function package($pkgfile = null, $compress = true)
{
+ // {{{ validate supplied package.xml file
if (empty($pkgfile)) {
$pkgfile = 'package.xml';
}
+ // $this->pkginfo gets populated inside
$pkginfo = $this->infoFromDescriptionFile($pkgfile);
if (PEAR::isError($pkginfo)) {
return $this->raiseError($pkginfo);
}
- if (empty($this->pkginfo['version'])) {
- return $this->raiseError("No version info found in $pkgfile");
- }
- // TMP DIR -------------------------------------------------
- // We allow calls like "pear package /home/user/mypack/package.xml"
- $oldcwd = getcwd();
- $dir = dirname($pkgfile);
- if (!@chdir($dir)) {
- return $this->raiseError('Could not chdir to '.$dir);
- }
+
+ $pkgdir = dirname(realpath($pkgfile));
$pkgfile = basename($pkgfile);
- if (@$this->pkginfo['release_state'] == 'snapshot' && empty($this->pkginfo['version'])) {
- $this->pkginfo['version'] = date('Ymd');
- }
- // don't want strange characters
- $pkgname = preg_replace('/[^a-z0-9._]/i', '_', $this->pkginfo['package']);
- $pkgversion = preg_replace('/[^a-z0-9._-]/i', '_', $this->pkginfo['version']);
- $pkgver = $pkgname . '-' . $pkgversion;
$errors = $warnings = array();
- $this->validatePackageInfo($this->pkginfo, $errors, $warnings, $dir);
+ $this->validatePackageInfo($pkginfo, $errors, $warnings, $pkgdir);
foreach ($warnings as $w) {
$this->log(1, "Warning: $w");
}
@@ -89,79 +76,80 @@ class PEAR_Packager extends PEAR_Common
$this->log(0, "Error: $e");
}
if (sizeof($errors) > 0) {
- chdir($oldcwd);
return $this->raiseError('Errors in package');
}
+ // }}}
- // ----- Create the package file list
+ $pkgver = $pkginfo['package'] . '-' . $pkginfo['version'];
+
+ // {{{ Create the package file list
$filelist = array();
$i = 0;
- // Copy files -----------------------------------------------
- foreach ($this->pkginfo['filelist'] as $fname => $atts) {
- if (!file_exists($fname)) {
- chdir($oldcwd);
+ foreach ($pkginfo['filelist'] as $fname => $atts) {
+ $file = $pkgdir . DIRECTORY_SEPARATOR . $fname;
+ if (!file_exists($file)) {
return $this->raiseError("File does not exist: $fname");
} else {
- $filelist[$i++] = $fname;
- if (empty($this->pkginfo['filelist'][$fname]['md5sum'])) {
- $md5sum = md5_file($fname);
- $this->pkginfo['filelist'][$fname]['md5sum'] = $md5sum;
+ $filelist[$i++] = $file;
+ if (empty($pkginfo['filelist'][$fname]['md5sum'])) {
+ $md5sum = md5_file($file);
+ $tpkginfo['filelist'][$fname]['md5sum'] = $md5sum;
}
$this->log(2, "Adding file $fname");
}
}
- $new_xml = $this->xmlFromInfo($this->pkginfo);
+ // }}}
+
+ // {{{ regenerate package.xml
+ $new_xml = $this->xmlFromInfo($pkginfo);
if (PEAR::isError($new_xml)) {
- chdir($oldcwd);
return $this->raiseError($new_xml);
}
- if (!($tmpdir = System::mktemp(array('-t', getcwd(), '-d')))) {
- chdir($oldcwd);
+ if (!($tmpdir = System::mktemp(array('-d')))) {
return $this->raiseError("PEAR_Packager: mktemp failed");
}
$newpkgfile = $tmpdir . DIRECTORY_SEPARATOR . 'package.xml';
- $np = @fopen($newpkgfile, "wb");
+ $np = @fopen($newpkgfile, 'wb');
if (!$np) {
- chdir($oldcwd);
return $this->raiseError("PEAR_Packager: unable to rewrite $pkgfile as $newpkgfile");
}
fwrite($np, $new_xml);
fclose($np);
+ // }}}
- // TAR the Package -------------------------------------------
+ // {{{ TAR the Package -------------------------------------------
$ext = $compress ? '.tgz' : '.tar';
- $dest_package = $oldcwd . DIRECTORY_SEPARATOR . $pkgver . $ext;
+ $dest_package = getcwd() . DIRECTORY_SEPARATOR . $pkgver . $ext;
$tar =& new Archive_Tar($dest_package, $compress);
$tar->setErrorHandling(PEAR_ERROR_RETURN); // XXX Don't print errors
// ----- Creates with the package.xml file
$ok = $tar->createModify(array($newpkgfile), '', $tmpdir);
if (PEAR::isError($ok)) {
- chdir($oldcwd);
return $this->raiseError($ok);
} elseif (!$ok) {
- chdir($oldcwd);
return $this->raiseError('PEAR_Packager: tarball creation failed');
}
// ----- Add the content of the package
- if (!$tar->addModify($filelist, $pkgver)) {
- chdir($oldcwd);
+ if (!$tar->addModify($filelist, $pkgver, $pkgdir)) {
return $this->raiseError('PEAR_Packager: tarball creation failed');
}
$this->log(1, "Package $dest_package done");
- if (file_exists("CVS/Root")) {
- $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $pkgversion);
+ if (file_exists("$pkgdir/CVS/Root")) {
+ $cvsversion = preg_replace('/[^a-z0-9]/i', '_', $pkginfo['version']);
$cvstag = "RELEASE_$cvsversion";
$this->log(1, "Tag the released code with `pear cvstag $pkgfile'");
$this->log(1, "(or set the CVS tag $cvstag by hand)");
}
- chdir($oldcwd);
+ // }}}
+
return $dest_package;
}
// }}}
}
+// {{{ md5_file() utility function
if (!function_exists('md5_file')) {
function md5_file($file) {
if (!$fd = @fopen($file, 'r')) {
@@ -172,5 +160,6 @@ if (!function_exists('md5_file')) {
return $md5;
}
}
+// }}}
?>
diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php
index eca2c38409..b49b674d2c 100644
--- a/pear/PEAR/Remote.php
+++ b/pear/PEAR/Remote.php
@@ -209,7 +209,9 @@ class PEAR_Remote extends PEAR
$proxy_user = @$proxy['user'];
$proxy_pass = @$proxy['pass'];
$fp = @fsockopen($proxy_host, $proxy_port);
+ $use_proxy = true;
} else {
+ $use_proxy = false;
$fp = @fsockopen($server_host, $server_port);
}
if (!$fp && $http_proxy) {
@@ -234,7 +236,7 @@ class PEAR_Remote extends PEAR
$maxAge = '';
};
- if ($proxy_host != '' && $proxy_user != '') {
+ if ($use_proxy && $proxy_host != '' && $proxy_user != '') {
$req_headers .= 'Proxy-Authorization: Basic '
.base64_encode($proxy_user.':'.$proxy_pass)
."\r\n";
@@ -247,7 +249,7 @@ class PEAR_Remote extends PEAR
var_dump($request);
}
- if ($proxy_host != '') {
+ if ($use_proxy && $proxy_host != '') {
$post_string = "POST http://".$server_host;
if ($proxy_port > '') {
$post_string .= ':'.$server_port;
diff --git a/pear/System.php b/pear/System.php
index 5915b6b5d2..28b66b1cd5 100644
--- a/pear/System.php
+++ b/pear/System.php
@@ -129,16 +129,16 @@ class System
closedir($dir);
sort($list);
if ($aktinst < $maxinst || $maxinst == 0) {
- foreach($list as $val) {
- $path = $sPath . DIRECTORY_SEPARATOR . $val;
- if (is_dir($path)) {
+ foreach($list as $val) {
+ $path = $sPath . DIRECTORY_SEPARATOR . $val;
+ if (is_dir($path)) {
$tmp = System::_dirToStruct($path, $maxinst, $aktinst+1);
$struct = array_merge_recursive($tmp, $struct);
- } else {
- $struct['files'][] = $path;
+ } else {
+ $struct['files'][] = $path;
+ }
}
}
- }
return $struct;
}
@@ -424,8 +424,8 @@ class System
*/
function which($program, $fallback = false)
{
- // is_executable() is not available on windows
- if (OS_WINDOWS) {
+ // is_executable() is not available on windows
+ if (OS_WINDOWS) {
$pear_is_executable = 'is_file';
} else {
$pear_is_executable = 'is_executable';
diff --git a/pear/package-PEAR.xml b/pear/package-PEAR.xml
index a00384be27..401b3247e1 100644
--- a/pear/package-PEAR.xml
+++ b/pear/package-PEAR.xml
@@ -8,6 +8,10 @@
* the PEAR_Error error handling mechanism
* the PEAR installer, for creating, distributing
and installing packages
+ * the OS_Guess class for retrieving info about the OS
+ where PHP is running on
+ * the System class for quick handling common operations
+ with files and directories
</description>
<license>PHP License</license>
<maintainers>
@@ -43,46 +47,16 @@
</maintainer>
</maintainers>
<release>
- <version>1.3b1</version>
- <date>2003-09-29</date>
+ <version>1.3b3</version>
+ <date>2003-10-20</date>
<state>beta</state>
<notes>
-PEAR Base Class:
-
-* Fixed static calls to PEAR error-handling methods in classes
-* Added ability to use a static method callback for error-handling,
- and removed use of inadvisable @ in setErrorHandling
-
PEAR Installer:
-* Fixed #25117 - MD5 checksum should be case-insensitive
-* Added dependency on XML_RPC, and optional dependency on xmlrpc extension
-* Added --alldeps and --onlyreqdeps options to pear install/pear upgrade
-* Sorting of installation/uninstallation so package order on the command-line is
- insignificant (fixes upgrade-all if every package is installed)
-* pear upgrade will now install if the package is not installed (necessary for
- pear upgrade --alldeps, as installation is often necessary for new
- dependencies)
-* fixed pear.bat if PHP is installed in a path like C:\Program Files\php
-* Added ability to specify &quot;pear install package-version&quot; or
- &quot;pear install package-state&quot;. For example: &quot;pear install DB-1.2&quot;,
- or &quot;pear install DB-stable&quot;
-* Fix #25008 - unhelpful error message
-* Fixed optional dependencies in Dependency.php
-* Fix #25322 - bad md5sum should be fatal error
-* Package uninstall now also removes empty directories
-* Fixed locking problems for reading commands (pear list, pear info)
-* Fixed #45 preferred_state works incorrectly
-
-OS_Guess Class:
-
-* Fixed #25131 - OS_Guess warnings on empty lines from
- popen(&quot;/usr/bin/cpp $tmpfile&quot;, &quot;r&quot;);
-
-System Class:
-
-* Fixed recursion deep param in _dirToStruct()
-* Added the System::find() command (read API doc for more info)
+* Bug #25413 Add local installed packages to list-all (Christian DickMann)
+* Bug #23221 Pear installer - extension re-install segfault
+* Better error detecting and reporting in "install/upgrade"
+* Various other bugfixes and cleanups
</notes>
<provides type="class" name="OS_Guess" />
@@ -144,8 +118,8 @@ System Class:
</filelist>
<deps>
<dep type="php" rel="ge" version="4.1"/>
- <dep type="pkg" rel="ge" version="0.4">Archive_Tar</dep>
- <dep type="pkg" rel="ge" version="0.11">Console_Getopt</dep>
+ <dep type="pkg" rel="ge" version="1.1">Archive_Tar</dep>
+ <dep type="pkg" rel="ge" version="1.0">Console_Getopt</dep>
<dep type="pkg" rel="ge" version="1.0.4">XML_RPC</dep>
<dep type="ext" rel="has" optional="yes">xmlrpc</dep>
</deps>
diff --git a/pear/scripts/pear.bat b/pear/scripts/pear.bat
index d5b795c7aa..44d84463b9 100755
--- a/pear/scripts/pear.bat
+++ b/pear/scripts/pear.bat
@@ -1,69 +1,69 @@
-@ECHO OFF
-
-REM ----------------------------------------------------------------------
-REM PHP version 4.0
-REM ----------------------------------------------------------------------
-REM Copyright (c) 1997-2002 The PHP Group
-REM ----------------------------------------------------------------------
-REM This source file is subject to version 3.0 of the PHP license,
-REM that is bundled with this package in the file LICENSE, and is
-REM available at through the world-wide-web at
-REM http://www.php.net/license/3_0.txt.
-REM If you did not receive a copy of the PHP license and are unable to
-REM obtain it through the world-wide-web, please send a note to
-REM license@php.net so we can mail you a copy immediately.
-REM ----------------------------------------------------------------------
-REM Authors: Alexander Merz (alexmerz@php.net)
-REM ----------------------------------------------------------------------
-REM
+@ECHO OFF
+
+REM ----------------------------------------------------------------------
+REM PHP version 4.0
+REM ----------------------------------------------------------------------
+REM Copyright (c) 1997-2002 The PHP Group
+REM ----------------------------------------------------------------------
+REM This source file is subject to version 3.0 of the PHP license,
+REM that is bundled with this package in the file LICENSE, and is
+REM available at through the world-wide-web at
+REM http://www.php.net/license/3_0.txt.
+REM If you did not receive a copy of the PHP license and are unable to
+REM obtain it through the world-wide-web, please send a note to
+REM license@php.net so we can mail you a copy immediately.
+REM ----------------------------------------------------------------------
+REM Authors: Alexander Merz (alexmerz@php.net)
+REM ----------------------------------------------------------------------
+REM
REM $Id: pear.bat,v 1.17 2003/08/29 21:21:27 cellog Exp $
-
-REM change this lines to match the paths of your system
-REM -------------------
-
-@ECHO OFF
-:: Check PEAR global ENV, set them if they do not exist
+
+REM change this lines to match the paths of your system
+REM -------------------
+
+@ECHO OFF
+:: Check PEAR global ENV, set them if they do not exist
IF "%PHP_PEAR_INSTALL_DIR%"=="" SET "PHP_PEAR_INSTALL_DIR=@include_path@"
IF "%PHP_PEAR_BIN_DIR%"=="" SET "PHP_PEAR_BIN_DIR=@bin_dir@"
IF "%PHP_PEAR_PHP_BIN%"=="" SET "PHP_PEAR_PHP_BIN=@php_bin@"
-
-:: Check Folders and files
+
+:: Check Folders and files
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%" GOTO PEAR_INSTALL_ERROR
IF NOT EXIST "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" GOTO PEAR_INSTALL_ERROR2
IF NOT EXIST "%PHP_PEAR_BIN_DIR%" GOTO PEAR_BIN_ERROR
IF NOT EXIST "%PHP_PEAR_PHP_BIN%" GOTO PEAR_PHPBIN_ERROR
-:: launch pearcmd
-GOTO RUN
-:PEAR_INSTALL_ERROR
-ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
-ECHO Please fix it using your environment variable or modify
-ECHO the default value in pear.bat
-ECHO The current value is:
-ECHO %PHP_PEAR_INSTALL_DIR%
-GOTO END
-:PEAR_INSTALL_ERROR2
-ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
-ECHO pearcmd.php could not be found there.
-ECHO Please fix it using your environment variable or modify
-ECHO the default value in pear.bat
-ECHO The current value is:
-ECHO %PHP_PEAR_INSTALL_DIR%
-GOTO END
-:PEAR_BIN_ERROR
-ECHO PHP_PEAR_BIN_DIR is not set correctly.
-ECHO Please fix it using your environment variable or modify
-ECHO the default value in pear.bat
-ECHO The current value is:
-ECHO %PHP_PEAR_BIN_DIR%
-GOTO END
-:PEAR_PHPBIN_ERROR
-ECHO PHP_PEAR_PHP_BIN is not set correctly.
-ECHO Please fix it using your environment variable or modify
-ECHO the default value in pear.bat
-ECHO The current value is:
-ECHO %PHP_PEAR_PHP_BIN%
-GOTO END
-:RUN
+:: launch pearcmd
+GOTO RUN
+:PEAR_INSTALL_ERROR
+ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
+ECHO Please fix it using your environment variable or modify
+ECHO the default value in pear.bat
+ECHO The current value is:
+ECHO %PHP_PEAR_INSTALL_DIR%
+GOTO END
+:PEAR_INSTALL_ERROR2
+ECHO PHP_PEAR_INSTALL_DIR is not set correctly.
+ECHO pearcmd.php could not be found there.
+ECHO Please fix it using your environment variable or modify
+ECHO the default value in pear.bat
+ECHO The current value is:
+ECHO %PHP_PEAR_INSTALL_DIR%
+GOTO END
+:PEAR_BIN_ERROR
+ECHO PHP_PEAR_BIN_DIR is not set correctly.
+ECHO Please fix it using your environment variable or modify
+ECHO the default value in pear.bat
+ECHO The current value is:
+ECHO %PHP_PEAR_BIN_DIR%
+GOTO END
+:PEAR_PHPBIN_ERROR
+ECHO PHP_PEAR_PHP_BIN is not set correctly.
+ECHO Please fix it using your environment variable or modify
+ECHO the default value in pear.bat
+ECHO The current value is:
+ECHO %PHP_PEAR_PHP_BIN%
+GOTO END
+:RUN
"%PHP_PEAR_PHP_BIN%" -C -d output_buffering=1 -d include_path="%PHP_PEAR_INSTALL_DIR%" -f "%PHP_PEAR_INSTALL_DIR%\pearcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9
-:END
-@ECHO ON
+:END
+@ECHO ON