cvs: php-src(PHP_4_3) /pear CMD.php CODING_STANDARDS PEAR.php System.php install-pear.php package.dtd /pear/Archive Tar.php /pear/PEAR
Autoloader.php Common.php Config.php Dependency.php Downloader.php Installer.php Packager.php Registry.php Remote.php /pear/PEAR/Frontend CLI.php
| From: | Pierre-Alain Joye | Date: | Mon, 26 Jan 2004 01:26:48 +0000 |
| Subject: | cvs: php-src(PHP_4_3) /pear CMD.php CODING_STANDARDS PEAR.php System.php install-pear.php package.dtd /pear/Archive Tar.php /pear/PEAR Autoloader.php Common.php Config.php Dependency.php Downloader.php Installer.php Packager.php Registry.php Remote.php /pear/PEAR/Frontend CLI.php |
||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-76@lists.php.net to get a copy of this message | ||
pajoye Sun Jan 25 20:26:48 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src/pear CMD.php CODING_STANDARDS PEAR.php System.php
install-pear.php package.dtd
/php-src/pear/Archive Tar.php
/php-src/pear/PEAR Autoloader.php Common.php Config.php
Dependency.php Downloader.php Installer.php
Packager.php Registry.php Remote.php
/php-src/pear/PEAR/Frontend CLI.php
Log:
MFH
http://cvs.php.net/diff.php/php-src/pear/CMD.php?r1=1.4.10.8&r2=1.4.10.9&ty=u Index: php-src/pear/CMD.php diff -u php-src/pear/CMD.php:1.4.10.8 php-src/pear/CMD.php:1.4.10.9 --- php-src/pear/CMD.php:1.4.10.8 Sun Jan 25 18:42:43 2004 +++ php-src/pear/CMD.php Sun Jan 25 20:26:43 2004 @@ -16,7 +16,7 @@ // | Author: Anders Johannsen <anders@johannsen.com> | // +----------------------------------------------------------------------+ // -define('CMD_RCSID', '$Id: CMD.php,v 1.4.10.8 2004/01/25 23:42:43 pajoye Exp $'); +define('CMD_RCSID', '$Id: CMD.php,v 1.4.10.9 2004/01/26 01:26:43 pajoye Exp $'); /** * The Cmd:: class implements an abstraction for various ways @@ -25,7 +25,7 @@ * register_shutdown_function() or as a detached process using nohup). * * @author Anders Johannsen <anders@johannsen.com> - * @version $Revision: 1.4.10.8 $ + * @version $Revision: 1.4.10.9 $ **/ require_once 'PEAR.php'; http://cvs.php.net/diff.php/php-src/pear/CODING_STANDARDS?r1=1.14.10.1&r2=1.14.10.2&ty=u Index: php-src/pear/CODING_STANDARDS diff -u php-src/pear/CODING_STANDARDS:1.14.10.1 php-src/pear/CODING_STANDARDS:1.14.10.2 --- php-src/pear/CODING_STANDARDS:1.14.10.1 Sun Jan 25 18:42:43 2004 +++ php-src/pear/CODING_STANDARDS Sun Jan 25 20:26:43 2004 @@ -2,7 +2,7 @@ | PEAR Coding Standards | =========================================================================== -$Id: CODING_STANDARDS,v 1.14.10.1 2004/01/25 23:42:43 pajoye Exp $ +$Id: CODING_STANDARDS,v 1.14.10.2 2004/01/26 01:26:43 pajoye Exp $ This document is no longer maintained, see http://pear.php.net/manual/ instead. http://cvs.php.net/diff.php/php-src/pear/PEAR.php?r1=1.50.2.15&r2=1.50.2.16&ty=u Index: php-src/pear/PEAR.php diff -u php-src/pear/PEAR.php:1.50.2.15 php-src/pear/PEAR.php:1.50.2.16 --- php-src/pear/PEAR.php:1.50.2.15 Sun Jan 25 18:54:49 2004 +++ php-src/pear/PEAR.php Sun Jan 25 20:26:43 2004 @@ -18,7 +18,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: PEAR.php,v 1.50.2.15 2004/01/25 23:54:49 pajoye Exp $ +// $Id: PEAR.php,v 1.50.2.16 2004/01/26 01:26:43 pajoye Exp $ // define('PEAR_ERROR_RETURN', 1); http://cvs.php.net/diff.php/php-src/pear/System.php?r1=1.21.2.14&r2=1.21.2.15&ty=u Index: php-src/pear/System.php diff -u php-src/pear/System.php:1.21.2.14 php-src/pear/System.php:1.21.2.15 --- php-src/pear/System.php:1.21.2.14 Sun Jan 25 18:42:43 2004 +++ php-src/pear/System.php Sun Jan 25 20:26:43 2004 @@ -16,7 +16,7 @@ // | Authors: Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: System.php,v 1.21.2.14 2004/01/25 23:42:43 pajoye Exp $ +// $Id: System.php,v 1.21.2.15 2004/01/26 01:26:43 pajoye Exp $ // require_once 'PEAR.php'; @@ -48,7 +48,7 @@ * * @package System * @author Tomas V.V.Cox <cox@idecnet.com> -* @version $Revision: 1.21.2.14 $ +* @version $Revision: 1.21.2.15 $ * @access public * @see http://pear.php.net/manual/ */ http://cvs.php.net/diff.php/php-src/pear/install-pear.php?r1=1.6.2.13&r2=1.6.2.14&ty=u Index: php-src/pear/install-pear.php diff -u php-src/pear/install-pear.php:1.6.2.13 php-src/pear/install-pear.php:1.6.2.14 --- php-src/pear/install-pear.php:1.6.2.13 Sun Jan 25 18:42:43 2004 +++ php-src/pear/install-pear.php Sun Jan 25 20:26:43 2004 @@ -1,6 +1,6 @@ <?php -/* $Id: install-pear.php,v 1.6.2.13 2004/01/25 23:42:43 pajoye Exp $ */ +/* $Id: install-pear.php,v 1.6.2.14 2004/01/26 01:26:43 pajoye Exp $ */ $pear_dir = dirname(__FILE__); ini_set('include_path', $pear_dir); http://cvs.php.net/diff.php/php-src/pear/package.dtd?r1=1.27.4.10&r2=1.27.4.11&ty=u Index: php-src/pear/package.dtd diff -u php-src/pear/package.dtd:1.27.4.10 php-src/pear/package.dtd:1.27.4.11 --- php-src/pear/package.dtd:1.27.4.10 Sun Jan 25 18:42:43 2004 +++ php-src/pear/package.dtd Sun Jan 25 20:26:43 2004 @@ -1,5 +1,5 @@ <!-- - $Id: package.dtd,v 1.27.4.10 2004/01/25 23:42:43 pajoye Exp $ + $Id: package.dtd,v 1.27.4.11 2004/01/26 01:26:43 pajoye Exp $ This is the PEAR package description, version 1.0. It should be used with the informal public identifier: http://cvs.php.net/diff.php/php-src/pear/Archive/Tar.php?r1=1.13.4.7&r2=1.13.4.8&ty=u Index: php-src/pear/Archive/Tar.php diff -u php-src/pear/Archive/Tar.php:1.13.4.7 php-src/pear/Archive/Tar.php:1.13.4.8 --- php-src/pear/Archive/Tar.php:1.13.4.7 Mon Sep 29 10:06:39 2003 +++ php-src/pear/Archive/Tar.php Sun Jan 25 20:26:45 2004 @@ -16,7 +16,7 @@ // | Author: Vincent Blavet <vincent@blavet.net> | // +----------------------------------------------------------------------+ // -// $Id: Tar.php,v 1.13.4.7 2003/09/29 14:06:39 pajoye Exp $ +// $Id: Tar.php,v 1.13.4.8 2004/01/26 01:26:45 pajoye Exp $ require_once 'PEAR.php'; @@ -24,7 +24,7 @@ * Creates a (compressed) Tar archive * * @author Vincent Blavet <vincent@blavet.net> -* @version $Revision: 1.13.4.7 $ +* @version $Revision: 1.13.4.8 $ * @package Archive */ class Archive_Tar extends PEAR @@ -1367,8 +1367,11 @@ // ----- Change the file mode, mtime @touch($v_header['filename'], $v_header['mtime']); - // To be completed - //chmod($v_header[filename], DecOct($v_header[mode])); + if ($v_header['mode'] & 0111) { + // make file executable, obey umask + $mode = fileperms($v_header['filename']) | (~umask() & 0111); + @chmod($v_header['filename'], $mode); + } } // ----- Check the file size http://cvs.php.net/diff.php/php-src/pear/PEAR/Autoloader.php?r1=1.4.6.10&r2=1.4.6.11&ty=u Index: php-src/pear/PEAR/Autoloader.php diff -u php-src/pear/PEAR/Autoloader.php:1.4.6.10 php-src/pear/PEAR/Autoloader.php:1.4.6.11 --- php-src/pear/PEAR/Autoloader.php:1.4.6.10 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Autoloader.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Autoloader.php,v 1.4.6.10 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Autoloader.php,v 1.4.6.11 2004/01/26 01:26:46 pajoye Exp $ if (!extension_loaded("overload")) { // die hard without ext/overload @@ -84,9 +84,10 @@ function addAutoload($method, $classname = null) { if (is_array($method)) { + array_walk($method, create_function('$a,&$b', '$b = strtolower($b);')); $this->_autoload_map = array_merge($this->_autoload_map, $method); } else { - $this->_autoload_map[$method] = $classname; + $this->_autoload_map[strtolower($method)] = $classname; } } @@ -104,6 +105,7 @@ */ function removeAutoload($method) { + $method = strtolower($method); $ok = isset($this->_autoload_map[$method]); unset($this->_autoload_map[$method]); return $ok; @@ -187,6 +189,7 @@ */ function __call($method, $args, &$retval) { + $method = strtolower($method); if (empty($this->_method_map[$method]) && isset($this->_autoload_map[$method])) { $this->addAggregateObject($this->_autoload_map[$method]); } http://cvs.php.net/diff.php/php-src/pear/PEAR/Common.php?r1=1.81.2.15&r2=1.81.2.16&ty=u Index: php-src/pear/PEAR/Common.php diff -u php-src/pear/PEAR/Common.php:1.81.2.15 php-src/pear/PEAR/Common.php:1.81.2.16 --- php-src/pear/PEAR/Common.php:1.81.2.15 Thu Dec 11 18:46:55 2003 +++ php-src/pear/PEAR/Common.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.81.2.15 2003/12/11 23:46:55 cellog Exp $ +// $Id: Common.php,v 1.81.2.16 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'Archive/Tar.php'; @@ -1052,6 +1052,7 @@ if (!is_array($info)) { return false; } + $errors = array(); $warnings = array(); if (!isset($info['package'])) { @@ -1059,6 +1060,8 @@ } elseif (!$this->validPackageName($info['package'])) { $errors[] = 'invalid package name'; } + $this->_packageName = $pn = $info['package']; + if (empty($info['summary'])) { $errors[] = 'missing summary'; } elseif (strpos(trim($info['summary']), "\n") !== false) { @@ -1175,12 +1178,13 @@ $this->buildProvidesArray($srcinfo); } } + // (ssb) Any checks we can do for baseinstalldir? // (cox) Perhaps checks that either the target dir and // baseInstall doesn't cointain "../../" } } - $pn = $info['package']; + $this->_packageName = $pn = $info['package']; $pnl = strlen($pn); foreach ((array)$this->pkginfo['provides'] as $key => $what) { if (isset($what['explicit'])) { @@ -1200,8 +1204,9 @@ } $warnings[] = "in $file: function \"$name\" not prefixed with package name \"$pn\""; } - //print "$file: provides $what[type] $what[name]\n"; } + + return true; } @@ -1229,13 +1234,16 @@ */ function buildProvidesArray($srcinfo) { + $file = basename($srcinfo['source_file']); + $pn = $this->_packageName; + $pnl = strlen($pn); foreach ($srcinfo['declared_classes'] as $class) { $key = "class;$class"; if (isset($this->pkginfo['provides'][$key])) { continue; } $this->pkginfo['provides'][$key] = - array('type' => 'class', 'name' => $class); + array('file'=> $file, 'type' => 'class', 'name' => $class); if (isset($srcinfo['inheritance'][$class])) { $this->pkginfo['provides'][$key]['extends'] = $srcinfo['inheritance'][$class]; @@ -1250,16 +1258,20 @@ continue; } $this->pkginfo['provides'][$key] = - array('type' => 'function', 'name' => $function); + array('file'=> $file, 'type' => 'function', 'name' => $function); } } + foreach ($srcinfo['declared_functions'] as $function) { $key = "function;$function"; if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) { continue; } + if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) { + $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\""; + } $this->pkginfo['provides'][$key] = - array('type' => 'function', 'name' => $function); + array('file'=> $file, 'type' => 'function', 'name' => $function); } } @@ -1310,6 +1322,7 @@ $used_functions = array(); $extends = array(); $nodeps = array(); + $inquote = false; for ($i = 0; $i < sizeof($tokens); $i++) { if (is_array($tokens[$i])) { list($token, $data) = $tokens[$i]; @@ -1317,7 +1330,17 @@ $token = $tokens[$i]; $data = ''; } + if ($inquote) { + if ($token != '"') { + continue; + } else { + $inquote = false; + } + } switch ($token) { + case '"': + $inquote = true; + break; case T_CURLY_OPEN: case T_DOLLAR_OPEN_CURLY_BRACES: case '{': $brace_level++; continue 2; @@ -1394,6 +1417,7 @@ } } return array( + "source_file" => $file, "declared_classes" => $declared_classes, "declared_methods" => $declared_methods, "declared_functions" => $declared_functions, http://cvs.php.net/diff.php/php-src/pear/PEAR/Config.php?r1=1.35.2.15&r2=1.35.2.16&ty=u Index: php-src/pear/PEAR/Config.php diff -u php-src/pear/PEAR/Config.php:1.35.2.15 php-src/pear/PEAR/Config.php:1.35.2.16 --- php-src/pear/PEAR/Config.php:1.35.2.15 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Config.php Sun Jan 25 20:26:46 2004 @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.35.2.15 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Config.php,v 1.35.2.16 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'System.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Dependency.php?r1=1.14.4.19&r2=1.14.4.20&ty=u Index: php-src/pear/PEAR/Dependency.php diff -u php-src/pear/PEAR/Dependency.php:1.14.4.19 php-src/pear/PEAR/Dependency.php:1.14.4.20 --- php-src/pear/PEAR/Dependency.php:1.14.4.19 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Dependency.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Dependency.php,v 1.14.4.19 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Dependency.php,v 1.14.4.20 2004/01/26 01:26:46 pajoye Exp $ require_once "PEAR.php"; http://cvs.php.net/diff.php/php-src/pear/PEAR/Downloader.php?r1=1.9.2.4&r2=1.9.2.5&ty=u Index: php-src/pear/PEAR/Downloader.php diff -u php-src/pear/PEAR/Downloader.php:1.9.2.4 php-src/pear/PEAR/Downloader.php:1.9.2.5 --- php-src/pear/PEAR/Downloader.php:1.9.2.4 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Downloader.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Downloader.php,v 1.9.2.4 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Downloader.php,v 1.9.2.5 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; @@ -129,6 +129,7 @@ $this->_options = $options; $this->_config = &$config; $this->_preferredState = $this->_config->get('preferred_state'); + $this->ui = &$ui; if (!$this->_preferredState) { // don't inadvertantly use a non-set preferred_state $this->_preferredState = null; @@ -149,7 +150,7 @@ array_walk($this->_installed, create_function('&$v,$k','$v = strtolower($v);')); $this->_installed = array_flip($this->_installed); } - parent::PEAR_Common($ui); + parent::PEAR_Common(); } // }}} @@ -443,6 +444,7 @@ foreach ($releases as $ver => $inf) { if ($inf['state'] == $state && version_compare("$version", "$ver") < 0) { $version = $ver; + break; } } if ($version == 0) { @@ -461,18 +463,19 @@ foreach ($releases as $ver => $inf) { if (in_array($inf['state'], $states) && version_compare("$version", "$ver") < 0) { $version = $ver; + break; } } - if ($version == 0 && !isset($this->_options['force'])) { + if ($version === 0 && !isset($this->_options['force'])) { return $this->raiseError('No release with state equal to: \'' . implode(', ', $states) . "' found for '$pkgfile'"); - } elseif ($version == 0) { + } elseif ($version === 0) { $this->log(0, "Warning: $pkgfile is state '$inf[state]' which is less stable " . "than state '$this->_preferredState'"); } } // Check if we haven't already the version - if (empty($this->_options['force'])) { + if (empty($this->_options['force']) && !is_null($curinfo)) { if ($curinfo['version'] == $version) { $this->log(0, "Package '{$curinfo['package']}-{$curinfo['version']}' already installed, skipping"); return false; @@ -580,6 +583,36 @@ } // }}} + // {{{ _downloadCallback() + + function _downloadCallback($msg, $params = null) + { + switch ($msg) { + case 'saveas': + $this->log(1, "downloading $params ..."); + break; + case 'done': + $this->log(1, '...done: ' . number_format($params, 0, '', ',') . ' bytes'); + break; + case 'bytesread': + static $bytes; + if (empty($bytes)) { + $bytes = 0; + } + if (!($bytes % 10240)) { + $this->log(1, '.', false); + } + $bytes += $params; + break; + case 'start': + $this->log(1, "Starting to download {$params[0]} (".number_format($params[1], 0, '', ',')." bytes)"); + break; + } + if (method_exists($this->ui, '_downloadCallback')) + $this->ui->_downloadCallback($msg, $params); + } + + // }}} // {{{ pushError($errmsg, $code) /** http://cvs.php.net/diff.php/php-src/pear/PEAR/Installer.php?r1=1.81.2.22&r2=1.81.2.23&ty=u Index: php-src/pear/PEAR/Installer.php diff -u php-src/pear/PEAR/Installer.php:1.81.2.22 php-src/pear/PEAR/Installer.php:1.81.2.23 --- php-src/pear/PEAR/Installer.php:1.81.2.22 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Installer.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.81.2.22 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Installer.php,v 1.81.2.23 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Packager.php?r1=1.43.2.11&r2=1.43.2.12&ty=u Index: php-src/pear/PEAR/Packager.php diff -u php-src/pear/PEAR/Packager.php:1.43.2.11 php-src/pear/PEAR/Packager.php:1.43.2.12 --- php-src/pear/PEAR/Packager.php:1.43.2.11 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Packager.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Packager.php,v 1.43.2.11 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Packager.php,v 1.43.2.12 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'System.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Registry.php?r1=1.35.2.16&r2=1.35.2.17&ty=u Index: php-src/pear/PEAR/Registry.php diff -u php-src/pear/PEAR/Registry.php:1.35.2.16 php-src/pear/PEAR/Registry.php:1.35.2.17 --- php-src/pear/PEAR/Registry.php:1.35.2.16 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Registry.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.35.2.16 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Registry.php,v 1.35.2.17 2004/01/26 01:26:46 pajoye Exp $ /* TODO: http://cvs.php.net/diff.php/php-src/pear/PEAR/Remote.php?r1=1.34.2.12&r2=1.34.2.13&ty=u Index: php-src/pear/PEAR/Remote.php diff -u php-src/pear/PEAR/Remote.php:1.34.2.12 php-src/pear/PEAR/Remote.php:1.34.2.13 --- php-src/pear/PEAR/Remote.php:1.34.2.12 Sat Dec 6 18:44:23 2003 +++ php-src/pear/PEAR/Remote.php Sun Jan 25 20:26:46 2004 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | +// | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Remote.php,v 1.34.2.12 2003/12/06 23:44:23 cellog Exp $ +// $Id: Remote.php,v 1.34.2.13 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'PEAR/Config.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Frontend/CLI.php?r1=1.25.2.14&r2=1.25.2.15&ty=u Index: php-src/pear/PEAR/Frontend/CLI.php diff -u php-src/pear/PEAR/Frontend/CLI.php:1.25.2.14 php-src/pear/PEAR/Frontend/CLI.php:1.25.2.15 --- php-src/pear/PEAR/Frontend/CLI.php:1.25.2.14 Sun Jan 25 18:20:00 2004 +++ php-src/pear/PEAR/Frontend/CLI.php Sun Jan 25 20:26:47 2004 @@ -16,7 +16,7 @@ | Author: Stig Sæther Bakken <ssb@php.net> | +----------------------------------------------------------------------+ - $Id: CLI.php,v 1.25.2.14 2004/01/25 23:20:00 pajoye Exp $ + $Id: CLI.php,v 1.25.2.15 2004/01/26 01:26:47 pajoye Exp $ */ require_once "PEAR.php";
http://cvs.php.net/diff.php/php-src/pear/CMD.php?r1=1.4.10.8&r2=1.4.10.9&ty=u Index: php-src/pear/CMD.php diff -u php-src/pear/CMD.php:1.4.10.8 php-src/pear/CMD.php:1.4.10.9 --- php-src/pear/CMD.php:1.4.10.8 Sun Jan 25 18:42:43 2004 +++ php-src/pear/CMD.php Sun Jan 25 20:26:43 2004 @@ -16,7 +16,7 @@ // | Author: Anders Johannsen <anders@johannsen.com> | // +----------------------------------------------------------------------+ // -define('CMD_RCSID', '$Id: CMD.php,v 1.4.10.8 2004/01/25 23:42:43 pajoye Exp $'); +define('CMD_RCSID', '$Id: CMD.php,v 1.4.10.9 2004/01/26 01:26:43 pajoye Exp $'); /** * The Cmd:: class implements an abstraction for various ways @@ -25,7 +25,7 @@ * register_shutdown_function() or as a detached process using nohup). * * @author Anders Johannsen <anders@johannsen.com> - * @version $Revision: 1.4.10.8 $ + * @version $Revision: 1.4.10.9 $ **/ require_once 'PEAR.php'; http://cvs.php.net/diff.php/php-src/pear/CODING_STANDARDS?r1=1.14.10.1&r2=1.14.10.2&ty=u Index: php-src/pear/CODING_STANDARDS diff -u php-src/pear/CODING_STANDARDS:1.14.10.1 php-src/pear/CODING_STANDARDS:1.14.10.2 --- php-src/pear/CODING_STANDARDS:1.14.10.1 Sun Jan 25 18:42:43 2004 +++ php-src/pear/CODING_STANDARDS Sun Jan 25 20:26:43 2004 @@ -2,7 +2,7 @@ | PEAR Coding Standards | =========================================================================== -$Id: CODING_STANDARDS,v 1.14.10.1 2004/01/25 23:42:43 pajoye Exp $ +$Id: CODING_STANDARDS,v 1.14.10.2 2004/01/26 01:26:43 pajoye Exp $ This document is no longer maintained, see http://pear.php.net/manual/ instead. http://cvs.php.net/diff.php/php-src/pear/PEAR.php?r1=1.50.2.15&r2=1.50.2.16&ty=u Index: php-src/pear/PEAR.php diff -u php-src/pear/PEAR.php:1.50.2.15 php-src/pear/PEAR.php:1.50.2.16 --- php-src/pear/PEAR.php:1.50.2.15 Sun Jan 25 18:54:49 2004 +++ php-src/pear/PEAR.php Sun Jan 25 20:26:43 2004 @@ -18,7 +18,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: PEAR.php,v 1.50.2.15 2004/01/25 23:54:49 pajoye Exp $ +// $Id: PEAR.php,v 1.50.2.16 2004/01/26 01:26:43 pajoye Exp $ // define('PEAR_ERROR_RETURN', 1); http://cvs.php.net/diff.php/php-src/pear/System.php?r1=1.21.2.14&r2=1.21.2.15&ty=u Index: php-src/pear/System.php diff -u php-src/pear/System.php:1.21.2.14 php-src/pear/System.php:1.21.2.15 --- php-src/pear/System.php:1.21.2.14 Sun Jan 25 18:42:43 2004 +++ php-src/pear/System.php Sun Jan 25 20:26:43 2004 @@ -16,7 +16,7 @@ // | Authors: Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: System.php,v 1.21.2.14 2004/01/25 23:42:43 pajoye Exp $ +// $Id: System.php,v 1.21.2.15 2004/01/26 01:26:43 pajoye Exp $ // require_once 'PEAR.php'; @@ -48,7 +48,7 @@ * * @package System * @author Tomas V.V.Cox <cox@idecnet.com> -* @version $Revision: 1.21.2.14 $ +* @version $Revision: 1.21.2.15 $ * @access public * @see http://pear.php.net/manual/ */ http://cvs.php.net/diff.php/php-src/pear/install-pear.php?r1=1.6.2.13&r2=1.6.2.14&ty=u Index: php-src/pear/install-pear.php diff -u php-src/pear/install-pear.php:1.6.2.13 php-src/pear/install-pear.php:1.6.2.14 --- php-src/pear/install-pear.php:1.6.2.13 Sun Jan 25 18:42:43 2004 +++ php-src/pear/install-pear.php Sun Jan 25 20:26:43 2004 @@ -1,6 +1,6 @@ <?php -/* $Id: install-pear.php,v 1.6.2.13 2004/01/25 23:42:43 pajoye Exp $ */ +/* $Id: install-pear.php,v 1.6.2.14 2004/01/26 01:26:43 pajoye Exp $ */ $pear_dir = dirname(__FILE__); ini_set('include_path', $pear_dir); http://cvs.php.net/diff.php/php-src/pear/package.dtd?r1=1.27.4.10&r2=1.27.4.11&ty=u Index: php-src/pear/package.dtd diff -u php-src/pear/package.dtd:1.27.4.10 php-src/pear/package.dtd:1.27.4.11 --- php-src/pear/package.dtd:1.27.4.10 Sun Jan 25 18:42:43 2004 +++ php-src/pear/package.dtd Sun Jan 25 20:26:43 2004 @@ -1,5 +1,5 @@ <!-- - $Id: package.dtd,v 1.27.4.10 2004/01/25 23:42:43 pajoye Exp $ + $Id: package.dtd,v 1.27.4.11 2004/01/26 01:26:43 pajoye Exp $ This is the PEAR package description, version 1.0. It should be used with the informal public identifier: http://cvs.php.net/diff.php/php-src/pear/Archive/Tar.php?r1=1.13.4.7&r2=1.13.4.8&ty=u Index: php-src/pear/Archive/Tar.php diff -u php-src/pear/Archive/Tar.php:1.13.4.7 php-src/pear/Archive/Tar.php:1.13.4.8 --- php-src/pear/Archive/Tar.php:1.13.4.7 Mon Sep 29 10:06:39 2003 +++ php-src/pear/Archive/Tar.php Sun Jan 25 20:26:45 2004 @@ -16,7 +16,7 @@ // | Author: Vincent Blavet <vincent@blavet.net> | // +----------------------------------------------------------------------+ // -// $Id: Tar.php,v 1.13.4.7 2003/09/29 14:06:39 pajoye Exp $ +// $Id: Tar.php,v 1.13.4.8 2004/01/26 01:26:45 pajoye Exp $ require_once 'PEAR.php'; @@ -24,7 +24,7 @@ * Creates a (compressed) Tar archive * * @author Vincent Blavet <vincent@blavet.net> -* @version $Revision: 1.13.4.7 $ +* @version $Revision: 1.13.4.8 $ * @package Archive */ class Archive_Tar extends PEAR @@ -1367,8 +1367,11 @@ // ----- Change the file mode, mtime @touch($v_header['filename'], $v_header['mtime']); - // To be completed - //chmod($v_header[filename], DecOct($v_header[mode])); + if ($v_header['mode'] & 0111) { + // make file executable, obey umask + $mode = fileperms($v_header['filename']) | (~umask() & 0111); + @chmod($v_header['filename'], $mode); + } } // ----- Check the file size http://cvs.php.net/diff.php/php-src/pear/PEAR/Autoloader.php?r1=1.4.6.10&r2=1.4.6.11&ty=u Index: php-src/pear/PEAR/Autoloader.php diff -u php-src/pear/PEAR/Autoloader.php:1.4.6.10 php-src/pear/PEAR/Autoloader.php:1.4.6.11 --- php-src/pear/PEAR/Autoloader.php:1.4.6.10 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Autoloader.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Autoloader.php,v 1.4.6.10 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Autoloader.php,v 1.4.6.11 2004/01/26 01:26:46 pajoye Exp $ if (!extension_loaded("overload")) { // die hard without ext/overload @@ -84,9 +84,10 @@ function addAutoload($method, $classname = null) { if (is_array($method)) { + array_walk($method, create_function('$a,&$b', '$b = strtolower($b);')); $this->_autoload_map = array_merge($this->_autoload_map, $method); } else { - $this->_autoload_map[$method] = $classname; + $this->_autoload_map[strtolower($method)] = $classname; } } @@ -104,6 +105,7 @@ */ function removeAutoload($method) { + $method = strtolower($method); $ok = isset($this->_autoload_map[$method]); unset($this->_autoload_map[$method]); return $ok; @@ -187,6 +189,7 @@ */ function __call($method, $args, &$retval) { + $method = strtolower($method); if (empty($this->_method_map[$method]) && isset($this->_autoload_map[$method])) { $this->addAggregateObject($this->_autoload_map[$method]); } http://cvs.php.net/diff.php/php-src/pear/PEAR/Common.php?r1=1.81.2.15&r2=1.81.2.16&ty=u Index: php-src/pear/PEAR/Common.php diff -u php-src/pear/PEAR/Common.php:1.81.2.15 php-src/pear/PEAR/Common.php:1.81.2.16 --- php-src/pear/PEAR/Common.php:1.81.2.15 Thu Dec 11 18:46:55 2003 +++ php-src/pear/PEAR/Common.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Common.php,v 1.81.2.15 2003/12/11 23:46:55 cellog Exp $ +// $Id: Common.php,v 1.81.2.16 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'Archive/Tar.php'; @@ -1052,6 +1052,7 @@ if (!is_array($info)) { return false; } + $errors = array(); $warnings = array(); if (!isset($info['package'])) { @@ -1059,6 +1060,8 @@ } elseif (!$this->validPackageName($info['package'])) { $errors[] = 'invalid package name'; } + $this->_packageName = $pn = $info['package']; + if (empty($info['summary'])) { $errors[] = 'missing summary'; } elseif (strpos(trim($info['summary']), "\n") !== false) { @@ -1175,12 +1178,13 @@ $this->buildProvidesArray($srcinfo); } } + // (ssb) Any checks we can do for baseinstalldir? // (cox) Perhaps checks that either the target dir and // baseInstall doesn't cointain "../../" } } - $pn = $info['package']; + $this->_packageName = $pn = $info['package']; $pnl = strlen($pn); foreach ((array)$this->pkginfo['provides'] as $key => $what) { if (isset($what['explicit'])) { @@ -1200,8 +1204,9 @@ } $warnings[] = "in $file: function \"$name\" not prefixed with package name \"$pn\""; } - //print "$file: provides $what[type] $what[name]\n"; } + + return true; } @@ -1229,13 +1234,16 @@ */ function buildProvidesArray($srcinfo) { + $file = basename($srcinfo['source_file']); + $pn = $this->_packageName; + $pnl = strlen($pn); foreach ($srcinfo['declared_classes'] as $class) { $key = "class;$class"; if (isset($this->pkginfo['provides'][$key])) { continue; } $this->pkginfo['provides'][$key] = - array('type' => 'class', 'name' => $class); + array('file'=> $file, 'type' => 'class', 'name' => $class); if (isset($srcinfo['inheritance'][$class])) { $this->pkginfo['provides'][$key]['extends'] = $srcinfo['inheritance'][$class]; @@ -1250,16 +1258,20 @@ continue; } $this->pkginfo['provides'][$key] = - array('type' => 'function', 'name' => $function); + array('file'=> $file, 'type' => 'function', 'name' => $function); } } + foreach ($srcinfo['declared_functions'] as $function) { $key = "function;$function"; if ($function{0} == '_' || isset($this->pkginfo['provides'][$key])) { continue; } + if (!strstr($function, '::') && strncasecmp($function, $pn, $pnl)) { + $warnings[] = "in1 " . $file . ": function \"$function\" not prefixed with package name \"$pn\""; + } $this->pkginfo['provides'][$key] = - array('type' => 'function', 'name' => $function); + array('file'=> $file, 'type' => 'function', 'name' => $function); } } @@ -1310,6 +1322,7 @@ $used_functions = array(); $extends = array(); $nodeps = array(); + $inquote = false; for ($i = 0; $i < sizeof($tokens); $i++) { if (is_array($tokens[$i])) { list($token, $data) = $tokens[$i]; @@ -1317,7 +1330,17 @@ $token = $tokens[$i]; $data = ''; } + if ($inquote) { + if ($token != '"') { + continue; + } else { + $inquote = false; + } + } switch ($token) { + case '"': + $inquote = true; + break; case T_CURLY_OPEN: case T_DOLLAR_OPEN_CURLY_BRACES: case '{': $brace_level++; continue 2; @@ -1394,6 +1417,7 @@ } } return array( + "source_file" => $file, "declared_classes" => $declared_classes, "declared_methods" => $declared_methods, "declared_functions" => $declared_functions, http://cvs.php.net/diff.php/php-src/pear/PEAR/Config.php?r1=1.35.2.15&r2=1.35.2.16&ty=u Index: php-src/pear/PEAR/Config.php diff -u php-src/pear/PEAR/Config.php:1.35.2.15 php-src/pear/PEAR/Config.php:1.35.2.16 --- php-src/pear/PEAR/Config.php:1.35.2.15 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Config.php Sun Jan 25 20:26:46 2004 @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.35.2.15 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Config.php,v 1.35.2.16 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'System.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Dependency.php?r1=1.14.4.19&r2=1.14.4.20&ty=u Index: php-src/pear/PEAR/Dependency.php diff -u php-src/pear/PEAR/Dependency.php:1.14.4.19 php-src/pear/PEAR/Dependency.php:1.14.4.20 --- php-src/pear/PEAR/Dependency.php:1.14.4.19 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Dependency.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Dependency.php,v 1.14.4.19 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Dependency.php,v 1.14.4.20 2004/01/26 01:26:46 pajoye Exp $ require_once "PEAR.php"; http://cvs.php.net/diff.php/php-src/pear/PEAR/Downloader.php?r1=1.9.2.4&r2=1.9.2.5&ty=u Index: php-src/pear/PEAR/Downloader.php diff -u php-src/pear/PEAR/Downloader.php:1.9.2.4 php-src/pear/PEAR/Downloader.php:1.9.2.5 --- php-src/pear/PEAR/Downloader.php:1.9.2.4 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Downloader.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Downloader.php,v 1.9.2.4 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Downloader.php,v 1.9.2.5 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; @@ -129,6 +129,7 @@ $this->_options = $options; $this->_config = &$config; $this->_preferredState = $this->_config->get('preferred_state'); + $this->ui = &$ui; if (!$this->_preferredState) { // don't inadvertantly use a non-set preferred_state $this->_preferredState = null; @@ -149,7 +150,7 @@ array_walk($this->_installed, create_function('&$v,$k','$v = strtolower($v);')); $this->_installed = array_flip($this->_installed); } - parent::PEAR_Common($ui); + parent::PEAR_Common(); } // }}} @@ -443,6 +444,7 @@ foreach ($releases as $ver => $inf) { if ($inf['state'] == $state && version_compare("$version", "$ver") < 0) { $version = $ver; + break; } } if ($version == 0) { @@ -461,18 +463,19 @@ foreach ($releases as $ver => $inf) { if (in_array($inf['state'], $states) && version_compare("$version", "$ver") < 0) { $version = $ver; + break; } } - if ($version == 0 && !isset($this->_options['force'])) { + if ($version === 0 && !isset($this->_options['force'])) { return $this->raiseError('No release with state equal to: \'' . implode(', ', $states) . "' found for '$pkgfile'"); - } elseif ($version == 0) { + } elseif ($version === 0) { $this->log(0, "Warning: $pkgfile is state '$inf[state]' which is less stable " . "than state '$this->_preferredState'"); } } // Check if we haven't already the version - if (empty($this->_options['force'])) { + if (empty($this->_options['force']) && !is_null($curinfo)) { if ($curinfo['version'] == $version) { $this->log(0, "Package '{$curinfo['package']}-{$curinfo['version']}' already installed, skipping"); return false; @@ -580,6 +583,36 @@ } // }}} + // {{{ _downloadCallback() + + function _downloadCallback($msg, $params = null) + { + switch ($msg) { + case 'saveas': + $this->log(1, "downloading $params ..."); + break; + case 'done': + $this->log(1, '...done: ' . number_format($params, 0, '', ',') . ' bytes'); + break; + case 'bytesread': + static $bytes; + if (empty($bytes)) { + $bytes = 0; + } + if (!($bytes % 10240)) { + $this->log(1, '.', false); + } + $bytes += $params; + break; + case 'start': + $this->log(1, "Starting to download {$params[0]} (".number_format($params[1], 0, '', ',')." bytes)"); + break; + } + if (method_exists($this->ui, '_downloadCallback')) + $this->ui->_downloadCallback($msg, $params); + } + + // }}} // {{{ pushError($errmsg, $code) /** http://cvs.php.net/diff.php/php-src/pear/PEAR/Installer.php?r1=1.81.2.22&r2=1.81.2.23&ty=u Index: php-src/pear/PEAR/Installer.php diff -u php-src/pear/PEAR/Installer.php:1.81.2.22 php-src/pear/PEAR/Installer.php:1.81.2.23 --- php-src/pear/PEAR/Installer.php:1.81.2.22 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Installer.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | Martin Jansen <mj@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.81.2.22 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Installer.php,v 1.81.2.23 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'PEAR/Registry.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Packager.php?r1=1.43.2.11&r2=1.43.2.12&ty=u Index: php-src/pear/PEAR/Packager.php diff -u php-src/pear/PEAR/Packager.php:1.43.2.11 php-src/pear/PEAR/Packager.php:1.43.2.12 --- php-src/pear/PEAR/Packager.php:1.43.2.11 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Packager.php Sun Jan 25 20:26:46 2004 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Packager.php,v 1.43.2.11 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Packager.php,v 1.43.2.12 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR/Common.php'; require_once 'System.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Registry.php?r1=1.35.2.16&r2=1.35.2.17&ty=u Index: php-src/pear/PEAR/Registry.php diff -u php-src/pear/PEAR/Registry.php:1.35.2.16 php-src/pear/PEAR/Registry.php:1.35.2.17 --- php-src/pear/PEAR/Registry.php:1.35.2.16 Sun Jan 25 18:19:58 2004 +++ php-src/pear/PEAR/Registry.php Sun Jan 25 20:26:46 2004 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Registry.php,v 1.35.2.16 2004/01/25 23:19:58 pajoye Exp $ +// $Id: Registry.php,v 1.35.2.17 2004/01/26 01:26:46 pajoye Exp $ /* TODO: http://cvs.php.net/diff.php/php-src/pear/PEAR/Remote.php?r1=1.34.2.12&r2=1.34.2.13&ty=u Index: php-src/pear/PEAR/Remote.php diff -u php-src/pear/PEAR/Remote.php:1.34.2.12 php-src/pear/PEAR/Remote.php:1.34.2.13 --- php-src/pear/PEAR/Remote.php:1.34.2.12 Sat Dec 6 18:44:23 2003 +++ php-src/pear/PEAR/Remote.php Sun Jan 25 20:26:46 2004 @@ -3,7 +3,7 @@ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ -// | Copyright (c) 1997-2003 The PHP Group | +// | Copyright (c) 1997-2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | @@ -16,7 +16,7 @@ // | Author: Stig Bakken <ssb@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Remote.php,v 1.34.2.12 2003/12/06 23:44:23 cellog Exp $ +// $Id: Remote.php,v 1.34.2.13 2004/01/26 01:26:46 pajoye Exp $ require_once 'PEAR.php'; require_once 'PEAR/Config.php'; http://cvs.php.net/diff.php/php-src/pear/PEAR/Frontend/CLI.php?r1=1.25.2.14&r2=1.25.2.15&ty=u Index: php-src/pear/PEAR/Frontend/CLI.php diff -u php-src/pear/PEAR/Frontend/CLI.php:1.25.2.14 php-src/pear/PEAR/Frontend/CLI.php:1.25.2.15 --- php-src/pear/PEAR/Frontend/CLI.php:1.25.2.14 Sun Jan 25 18:20:00 2004 +++ php-src/pear/PEAR/Frontend/CLI.php Sun Jan 25 20:26:47 2004 @@ -16,7 +16,7 @@ | Author: Stig Sæther Bakken <ssb@php.net> | +----------------------------------------------------------------------+ - $Id: CLI.php,v 1.25.2.14 2004/01/25 23:20:00 pajoye Exp $ + $Id: CLI.php,v 1.25.2.15 2004/01/26 01:26:47 pajoye Exp $ */ require_once "PEAR.php";