From 90ff65cf45284f90b1c4e09fe575319b320f56ac Mon Sep 17 00:00:00 2001 From: Nik Okuntseff Date: Sun, 11 Sep 2016 20:03:12 +0000 Subject: [PATCH] Updated PEAR and PEAR packages. --- WEB-INF/lib/pear/INSTALL | 2 - WEB-INF/lib/pear/Mail.php | 31 +- WEB-INF/lib/pear/Mail/RFC822.php | 84 +- WEB-INF/lib/pear/Mail/mail.php | 12 +- WEB-INF/lib/pear/Mail/mock.php | 19 +- WEB-INF/lib/pear/Mail/null.php | 9 +- WEB-INF/lib/pear/Mail/sendmail.php | 10 +- WEB-INF/lib/pear/Mail/smtp.php | 43 +- WEB-INF/lib/pear/Mail/smtpmx.php | 10 +- WEB-INF/lib/pear/Net/SMTP.php | 954 ++++++++++-------- WEB-INF/lib/pear/Net/Socket.php | 304 ++++-- WEB-INF/lib/pear/OS/Guess.php | 7 +- WEB-INF/lib/pear/PEAR.php | 185 ++-- WEB-INF/lib/pear/PEAR/Autoloader.php | 5 +- WEB-INF/lib/pear/PEAR/Builder.php | 32 +- WEB-INF/lib/pear/PEAR/ChannelFile.php | 33 +- WEB-INF/lib/pear/PEAR/ChannelFile/Parser.php | 3 +- WEB-INF/lib/pear/PEAR/Command.php | 53 +- WEB-INF/lib/pear/PEAR/Command/Auth.php | 9 +- WEB-INF/lib/pear/PEAR/Command/Build.php | 11 +- WEB-INF/lib/pear/PEAR/Command/Channels.php | 11 +- WEB-INF/lib/pear/PEAR/Command/Common.php | 9 +- WEB-INF/lib/pear/PEAR/Command/Config.php | 12 +- WEB-INF/lib/pear/PEAR/Command/Install.php | 39 +- WEB-INF/lib/pear/PEAR/Command/Mirror.php | 11 +- WEB-INF/lib/pear/PEAR/Command/Package.php | 21 +- WEB-INF/lib/pear/PEAR/Command/Pickle.php | 13 +- WEB-INF/lib/pear/PEAR/Command/Registry.php | 13 +- WEB-INF/lib/pear/PEAR/Command/Remote.php | 17 +- WEB-INF/lib/pear/PEAR/Command/Test.php | 18 +- WEB-INF/lib/pear/PEAR/Common.php | 87 +- WEB-INF/lib/pear/PEAR/Config.php | 90 +- WEB-INF/lib/pear/PEAR/Dependency2.php | 19 +- WEB-INF/lib/pear/PEAR/DependencyDB.php | 21 +- WEB-INF/lib/pear/PEAR/Downloader.php | 90 +- WEB-INF/lib/pear/PEAR/Downloader/Package.php | 47 +- WEB-INF/lib/pear/PEAR/ErrorStack.php | 70 +- WEB-INF/lib/pear/PEAR/Exception.php | 3 +- WEB-INF/lib/pear/PEAR/FixPHP5PEARWarnings.php | 7 - WEB-INF/lib/pear/PEAR/Frontend.php | 17 +- WEB-INF/lib/pear/PEAR/Frontend/CLI.php | 9 +- WEB-INF/lib/pear/PEAR/Installer.php | 83 +- WEB-INF/lib/pear/PEAR/Installer/Role.php | 26 +- WEB-INF/lib/pear/PEAR/Installer/Role/Cfg.php | 3 +- .../lib/pear/PEAR/Installer/Role/Common.php | 7 +- WEB-INF/lib/pear/PEAR/Installer/Role/Data.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Doc.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Ext.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Man.php | 28 + WEB-INF/lib/pear/PEAR/Installer/Role/Man.xml | 15 + WEB-INF/lib/pear/PEAR/Installer/Role/Php.php | 3 +- .../lib/pear/PEAR/Installer/Role/Script.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Src.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Test.php | 3 +- WEB-INF/lib/pear/PEAR/Installer/Role/Www.php | 3 +- WEB-INF/lib/pear/PEAR/PackageFile.php | 7 +- .../pear/PEAR/PackageFile/Generator/v1.php | 28 +- .../pear/PEAR/PackageFile/Generator/v2.php | 23 +- .../lib/pear/PEAR/PackageFile/Parser/v1.php | 3 +- .../lib/pear/PEAR/PackageFile/Parser/v2.php | 5 +- WEB-INF/lib/pear/PEAR/PackageFile/v1.php | 20 +- WEB-INF/lib/pear/PEAR/PackageFile/v2.php | 29 +- .../pear/PEAR/PackageFile/v2/Validator.php | 35 +- WEB-INF/lib/pear/PEAR/PackageFile/v2/rw.php | 5 +- WEB-INF/lib/pear/PEAR/Packager.php | 5 +- WEB-INF/lib/pear/PEAR/REST.php | 45 +- WEB-INF/lib/pear/PEAR/REST/10.php | 9 +- WEB-INF/lib/pear/PEAR/REST/11.php | 9 +- WEB-INF/lib/pear/PEAR/REST/13.php | 101 +- WEB-INF/lib/pear/PEAR/Registry.php | 51 +- WEB-INF/lib/pear/PEAR/RunTest.php | 66 +- WEB-INF/lib/pear/PEAR/Task/Common.php | 143 +-- .../lib/pear/PEAR/Task/Postinstallscript.php | 332 +++--- .../pear/PEAR/Task/Postinstallscript/rw.php | 125 ++- WEB-INF/lib/pear/PEAR/Task/Replace.php | 74 +- WEB-INF/lib/pear/PEAR/Task/Replace/rw.php | 30 +- WEB-INF/lib/pear/PEAR/Task/Unixeol.php | 50 +- WEB-INF/lib/pear/PEAR/Task/Unixeol/rw.php | 29 +- WEB-INF/lib/pear/PEAR/Task/Windowseol.php | 65 +- WEB-INF/lib/pear/PEAR/Task/Windowseol/rw.php | 44 +- WEB-INF/lib/pear/PEAR/Validate.php | 18 +- WEB-INF/lib/pear/PEAR/Validator/PECL.php | 3 +- WEB-INF/lib/pear/PEAR/XMLParser.php | 8 +- WEB-INF/lib/pear/PEAR5.php | 33 - WEB-INF/lib/pear/README | 32 - WEB-INF/lib/pear/README.rst | 88 ++ WEB-INF/lib/pear/System.php | 79 +- WEB-INF/lib/pear/scripts/pear.bat | 220 ++-- WEB-INF/lib/pear/scripts/pearcmd.php | 353 ++++--- WEB-INF/lib/pear/scripts/peardev.bat | 228 ++--- WEB-INF/lib/pear/scripts/pecl.bat | 228 ++--- WEB-INF/lib/pear/scripts/peclcmd.php | 7 +- WEB-INF/templates/footer.tpl | 2 +- 93 files changed, 2805 insertions(+), 2453 deletions(-) delete mode 100644 WEB-INF/lib/pear/PEAR/FixPHP5PEARWarnings.php create mode 100644 WEB-INF/lib/pear/PEAR/Installer/Role/Man.php create mode 100644 WEB-INF/lib/pear/PEAR/Installer/Role/Man.xml delete mode 100644 WEB-INF/lib/pear/PEAR5.php delete mode 100644 WEB-INF/lib/pear/README create mode 100644 WEB-INF/lib/pear/README.rst diff --git a/WEB-INF/lib/pear/INSTALL b/WEB-INF/lib/pear/INSTALL index 08f4c0b0..1312bc88 100644 --- a/WEB-INF/lib/pear/INSTALL +++ b/WEB-INF/lib/pear/INSTALL @@ -50,5 +50,3 @@ a public mailing list devoted to support for PEAR packages and installation- related issues. Happy PHPing, we hope PEAR will be a great tool for your development work! - -$Id: INSTALL 313023 2011-07-06 19:17:11Z dufuz $ \ No newline at end of file diff --git a/WEB-INF/lib/pear/Mail.php b/WEB-INF/lib/pear/Mail.php index 75132ac2..e7cff2f6 100644 --- a/WEB-INF/lib/pear/Mail.php +++ b/WEB-INF/lib/pear/Mail.php @@ -1,8 +1,8 @@ * @copyright 1997-2010 Chuck Hagenbuch * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ @@ -50,8 +50,7 @@ require_once 'PEAR.php'; * mailers under the PEAR hierarchy, and provides supporting functions * useful in multiple mailer backends. * - * @access public - * @version $Revision: 294747 $ + * @version $Revision$ * @package Mail */ class Mail @@ -60,7 +59,7 @@ class Mail * Line terminator used for separating header lines. * @var string */ - var $sep = "\r\n"; + public $sep = "\r\n"; /** * Provides an interface for generating Mail:: objects of various @@ -68,10 +67,10 @@ class Mail * * @param string $driver The kind of Mail:: object to instantiate. * @param array $params The parameters to pass to the Mail:: object. + * * @return object Mail a instance of the driver class or if fails a PEAR Error - * @access public */ - function &factory($driver, $params = array()) + public static function factory($driver, $params = array()) { $driver = strtolower($driver); @include_once 'Mail/' . $driver . '.php'; @@ -108,10 +107,9 @@ class Mail * containing a descriptive error message on * failure. * - * @access public * @deprecated use Mail_mail::send instead */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { if (!is_array($headers)) { return PEAR::raiseError('$headers must be an array'); @@ -147,10 +145,8 @@ class Mail * filter is to prevent mail injection attacks. * * @param array $headers The associative array of headers to sanitize. - * - * @access private */ - function _sanitizeHeaders(&$headers) + protected function _sanitizeHeaders(&$headers) { foreach ($headers as $key => $value) { $headers[$key] = @@ -173,9 +169,8 @@ class Mail * otherwise returns an array containing two * elements: Any From: address found in the headers, * and the plain text version of the headers. - * @access private */ - function prepareHeaders($headers) + protected function prepareHeaders($headers) { $lines = array(); $from = null; @@ -235,9 +230,8 @@ class Mail * * @return mixed An array of forward paths (bare addresses) or a PEAR_Error * object if the address list could not be parsed. - * @access private */ - function parseRecipients($recipients) + protected function parseRecipients($recipients) { include_once 'Mail/RFC822.php'; @@ -250,7 +244,8 @@ class Mail // Parse recipients, leaving out all personal info. This is // for smtp recipients, etc. All relevant personal information // should already be in the headers. - $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false); + $Mail_RFC822 = new Mail_RFC822(); + $addresses = $Mail_RFC822->parseAddressList($recipients, 'localhost', false); // If parseAddressList() returned a PEAR_Error object, just return it. if (is_a($addresses, 'PEAR_Error')) { diff --git a/WEB-INF/lib/pear/Mail/RFC822.php b/WEB-INF/lib/pear/Mail/RFC822.php index 58d36465..d010a20e 100644 --- a/WEB-INF/lib/pear/Mail/RFC822.php +++ b/WEB-INF/lib/pear/Mail/RFC822.php @@ -2,7 +2,7 @@ /** * RFC 822 Email address list validation Utility * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: * @@ -40,7 +40,7 @@ * @author Chuck Hagenbuch * @author Chuck Hagenbuch - * @version $Revision: 294749 $ + * @version $Revision$ * @license BSD * @package Mail */ @@ -141,7 +141,6 @@ class Mail_RFC822 { * Sets up the object. The address must either be set here or when * calling parseAddressList(). One or the other. * - * @access public * @param string $address The address(es) to validate. * @param string $default_domain Default domain/host etc. If not supplied, will be set to localhost. * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing. @@ -149,7 +148,7 @@ class Mail_RFC822 { * * @return object Mail_RFC822 A new Mail_RFC822 object. */ - function Mail_RFC822($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) + public function __construct($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) { if (isset($address)) $this->address = $address; if (isset($default_domain)) $this->default_domain = $default_domain; @@ -162,7 +161,6 @@ class Mail_RFC822 { * Starts the whole process. The address must either be set here * or when creating the object. One or the other. * - * @access public * @param string $address The address(es) to validate. * @param string $default_domain Default domain/host etc. * @param boolean $nest_groups Whether to return the structure with groups nested for easier viewing. @@ -170,7 +168,7 @@ class Mail_RFC822 { * * @return array A structured array of addresses. */ - function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) + public function parseAddressList($address = null, $default_domain = null, $nest_groups = null, $validate = null, $limit = null) { if (!isset($this) || !isset($this->mailRFC822)) { $obj = new Mail_RFC822($address, $default_domain, $nest_groups, $validate, $limit); @@ -222,11 +220,10 @@ class Mail_RFC822 { /** * Splits an address into separate addresses. * - * @access private * @param string $address The addresses to split. * @return boolean Success or failure. */ - function _splitAddresses($address) + protected function _splitAddresses($address) { if (!empty($this->limit) && count($this->addresses) == $this->limit) { return ''; @@ -298,11 +295,10 @@ class Mail_RFC822 { /** * Checks for a group at the start of the string. * - * @access private * @param string $address The address to check. * @return boolean Whether or not there is a group at the start of the string. */ - function _isGroup($address) + protected function _isGroup($address) { // First comma not in quotes, angles or escaped: $parts = explode(',', $address); @@ -322,12 +318,11 @@ class Mail_RFC822 { /** * A common function that will check an exploded string. * - * @access private * @param array $parts The exloded string. * @param string $char The char that was exploded on. * @return mixed False if the string contains unclosed quotes/brackets, or the string on success. */ - function _splitCheck($parts, $char) + protected function _splitCheck($parts, $char) { $string = $parts[0]; @@ -355,12 +350,11 @@ class Mail_RFC822 { /** * Checks if a string has unclosed quotes or not. * - * @access private * @param string $string The string to check. * @return boolean True if there are unclosed quotes inside the string, * false otherwise. */ - function _hasUnclosedQuotes($string) + protected function _hasUnclosedQuotes($string) { $string = trim($string); $iMax = strlen($string); @@ -392,12 +386,11 @@ class Mail_RFC822 { * Checks if a string has an unclosed brackets or not. IMPORTANT: * This function handles both angle brackets and square brackets; * - * @access private * @param string $string The string to check. * @param string $chars The characters to check for. * @return boolean True if there are unclosed brackets inside the string, false otherwise. */ - function _hasUnclosedBrackets($string, $chars) + protected function _hasUnclosedBrackets($string, $chars) { $num_angle_start = substr_count($string, $chars[0]); $num_angle_end = substr_count($string, $chars[1]); @@ -416,13 +409,12 @@ class Mail_RFC822 { /** * Sub function that is used only by hasUnclosedBrackets(). * - * @access private * @param string $string The string to check. * @param integer &$num The number of occurences. * @param string $char The character to count. * @return integer The number of occurences of $char in $string, adjusted for backslashes. */ - function _hasUnclosedBracketsSub($string, &$num, $char) + protected function _hasUnclosedBracketsSub($string, &$num, $char) { $parts = explode($char, $string); for ($i = 0; $i < count($parts); $i++){ @@ -438,11 +430,10 @@ class Mail_RFC822 { /** * Function to begin checking the address. * - * @access private * @param string $address The address to validate. * @return mixed False on failure, or a structured array of address information on success. */ - function _validateAddress($address) + protected function _validateAddress($address) { $is_group = false; $addresses = array(); @@ -483,14 +474,6 @@ class Mail_RFC822 { $addresses[] = $address['address']; } - // Check that $addresses is set, if address like this: - // Groupname:; - // Then errors were appearing. - if (!count($addresses)){ - $this->error = 'Empty group.'; - return false; - } - // Trim the whitespace from all of the address strings. array_map('trim', $addresses); @@ -531,11 +514,10 @@ class Mail_RFC822 { /** * Function to validate a phrase. * - * @access private * @param string $phrase The phrase to check. * @return boolean Success or failure. */ - function _validatePhrase($phrase) + protected function _validatePhrase($phrase) { // Splits on one or more Tab or space. $parts = preg_split('/[ \\x09]+/', $phrase, -1, PREG_SPLIT_NO_EMPTY); @@ -572,11 +554,10 @@ class Mail_RFC822 { * can split a list of addresses up before encoding personal names * (umlauts, etc.), for example. * - * @access private * @param string $atom The string to check. * @return boolean Success or failure. */ - function _validateAtom($atom) + protected function _validateAtom($atom) { if (!$this->validate) { // Validation has been turned off; assume the atom is okay. @@ -605,11 +586,10 @@ class Mail_RFC822 { * Function to validate quoted string, which is: * quoted-string = <"> *(qtext/quoted-pair) <"> * - * @access private * @param string $qstring The string to check * @return boolean Success or failure. */ - function _validateQuotedString($qstring) + protected function _validateQuotedString($qstring) { // Leading and trailing " $qstring = substr($qstring, 1, -1); @@ -623,11 +603,10 @@ class Mail_RFC822 { * mailbox = addr-spec ; simple address * / phrase route-addr ; name and route-addr * - * @access public * @param string &$mailbox The string to check. * @return boolean Success or failure. */ - function validateMailbox(&$mailbox) + public function validateMailbox(&$mailbox) { // A couple of defaults. $phrase = ''; @@ -712,11 +691,10 @@ class Mail_RFC822 { * Angle brackets have already been removed at the point of * getting to this function. * - * @access private * @param string $route_addr The string to check. * @return mixed False on failure, or an array containing validated address/route information on success. */ - function _validateRouteAddr($route_addr) + protected function _validateRouteAddr($route_addr) { // Check for colon. if (strpos($route_addr, ':') !== false) { @@ -762,11 +740,10 @@ class Mail_RFC822 { * Function to validate a route, which is: * route = 1#("@" domain) ":" * - * @access private * @param string $route The string to check. * @return mixed False on failure, or the validated $route on success. */ - function _validateRoute($route) + protected function _validateRoute($route) { // Split on comma. $domains = explode(',', trim($route)); @@ -785,11 +762,10 @@ class Mail_RFC822 { * * domain = sub-domain *("." sub-domain) * - * @access private * @param string $domain The string to check. * @return mixed False on failure, or the validated domain on success. */ - function _validateDomain($domain) + protected function _validateDomain($domain) { // Note the different use of $subdomains and $sub_domains $subdomains = explode('.', $domain); @@ -813,11 +789,10 @@ class Mail_RFC822 { * Function to validate a subdomain: * subdomain = domain-ref / domain-literal * - * @access private * @param string $subdomain The string to check. * @return boolean Success or failure. */ - function _validateSubdomain($subdomain) + protected function _validateSubdomain($subdomain) { if (preg_match('|^\[(.*)]$|', $subdomain, $arr)){ if (!$this->_validateDliteral($arr[1])) return false; @@ -833,11 +808,10 @@ class Mail_RFC822 { * Function to validate a domain literal: * domain-literal = "[" *(dtext / quoted-pair) "]" * - * @access private * @param string $dliteral The string to check. * @return boolean Success or failure. */ - function _validateDliteral($dliteral) + protected function _validateDliteral($dliteral) { return !preg_match('/(.)[][\x0D\\\\]/', $dliteral, $matches) && $matches[1] != '\\'; } @@ -847,11 +821,10 @@ class Mail_RFC822 { * * addr-spec = local-part "@" domain * - * @access private * @param string $addr_spec The string to check. * @return mixed False on failure, or the validated addr-spec on success. */ - function _validateAddrSpec($addr_spec) + protected function _validateAddrSpec($addr_spec) { $addr_spec = trim($addr_spec); @@ -878,17 +851,16 @@ class Mail_RFC822 { * Function to validate the local part of an address: * local-part = word *("." word) * - * @access private * @param string $local_part * @return mixed False on failure, or the validated local part on success. */ - function _validateLocalPart($local_part) + protected function _validateLocalPart($local_part) { $parts = explode('.', $local_part); $words = array(); // Split the local_part into words. - while (count($parts) > 0){ + while (count($parts) > 0) { $words[] = $this->_splitCheck($parts, '.'); for ($i = 0; $i < $this->index + 1; $i++) { array_shift($parts); @@ -897,6 +869,10 @@ class Mail_RFC822 { // Validate each word. foreach ($words as $word) { + // word cannot be empty (#17317) + if ($word === '') { + return false; + } // If this word contains an unquoted space, it is invalid. (6.2.4) if (strpos($word, ' ') && $word[0] !== '"') { @@ -920,7 +896,7 @@ class Mail_RFC822 { * @param string $data Addresses to count * @return int Approximate count */ - function approximateCount($data) + public function approximateCount($data) { return count(preg_split('/(? * @copyright 2010 Chuck Hagenbuch * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: mail.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ /** * internal PHP-mail() implementation of the PEAR Mail:: interface. * @package Mail - * @version $Revision: 294747 $ + * @version $Revision$ */ class Mail_mail extends Mail { @@ -64,7 +64,7 @@ class Mail_mail extends Mail { * * @param array $params Extra arguments for the mail() function. */ - function Mail_mail($params = null) + public function __construct($params = null) { // The other mail implementations accept parameters as arrays. // In the interest of being consistent, explode an array into @@ -109,10 +109,8 @@ class Mail_mail extends Mail { * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * - * @access public */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { if (!is_array($headers)) { return PEAR::raiseError('$headers must be an array'); diff --git a/WEB-INF/lib/pear/Mail/mock.php b/WEB-INF/lib/pear/Mail/mock.php index 61570ba4..e3e290bd 100644 --- a/WEB-INF/lib/pear/Mail/mock.php +++ b/WEB-INF/lib/pear/Mail/mock.php @@ -2,7 +2,7 @@ /** * Mock implementation * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: * @@ -39,7 +39,7 @@ * @author Chuck Hagenbuch * @copyright 2010 Chuck Hagenbuch * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: mock.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ @@ -47,7 +47,7 @@ * Mock implementation of the PEAR Mail:: interface for testing. * @access public * @package Mail - * @version $Revision: 294747 $ + * @version $Revision$ */ class Mail_mock extends Mail { @@ -55,23 +55,22 @@ class Mail_mock extends Mail { * Array of messages that have been sent with the mock. * * @var array - * @access public */ - var $sentMessages = array(); + public $sentMessages = array(); /** * Callback before sending mail. * * @var callback */ - var $_preSendCallback; + protected $_preSendCallback; /** * Callback after sending mai. * * @var callback */ - var $_postSendCallback; + protected $_postSendCallback; /** * Constructor. @@ -82,9 +81,8 @@ class Mail_mock extends Mail { * postSendCallback Called after an email would have been sent. * * @param array Hash containing any parameters. - * @access public */ - function Mail_mock($params) + public function __construct($params) { if (isset($params['preSendCallback']) && is_callable($params['preSendCallback'])) { @@ -120,9 +118,8 @@ class Mail_mock extends Mail { * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * @access public */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { if ($this->_preSendCallback) { call_user_func_array($this->_preSendCallback, diff --git a/WEB-INF/lib/pear/Mail/null.php b/WEB-INF/lib/pear/Mail/null.php index f8d58272..7896a429 100644 --- a/WEB-INF/lib/pear/Mail/null.php +++ b/WEB-INF/lib/pear/Mail/null.php @@ -2,7 +2,7 @@ /** * Null implementation of the PEAR Mail interface * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: * @@ -39,7 +39,7 @@ * @author Phil Kernick * @copyright 2010 Phil Kernick * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: null.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ @@ -47,7 +47,7 @@ * Null implementation of the PEAR Mail:: interface. * @access public * @package Mail - * @version $Revision: 294747 $ + * @version $Revision$ */ class Mail_null extends Mail { @@ -74,9 +74,8 @@ class Mail_null extends Mail { * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * @access public */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { return true; } diff --git a/WEB-INF/lib/pear/Mail/sendmail.php b/WEB-INF/lib/pear/Mail/sendmail.php index b056575e..f8866bdf 100644 --- a/WEB-INF/lib/pear/Mail/sendmail.php +++ b/WEB-INF/lib/pear/Mail/sendmail.php @@ -1,7 +1,7 @@ sendmail_path = $params['sendmail_path']; @@ -100,9 +99,8 @@ class Mail_sendmail extends Mail { * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * @access public */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { if (!is_array($headers)) { return PEAR::raiseError('$headers must be an array'); diff --git a/WEB-INF/lib/pear/Mail/smtp.php b/WEB-INF/lib/pear/Mail/smtp.php index 52ea6020..d446b1bc 100644 --- a/WEB-INF/lib/pear/Mail/smtp.php +++ b/WEB-INF/lib/pear/Mail/smtp.php @@ -2,7 +2,7 @@ /** * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class. * - * PHP versions 4 and 5 + * PHP version 5 * * LICENSE: * @@ -40,7 +40,7 @@ * @author Chuck Hagenbuch * @copyright 2010 Chuck Hagenbuch * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: smtp.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ @@ -69,7 +69,7 @@ define('PEAR_MAIL_SMTP_ERROR_DATA', 10006); * SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class. * @access public * @package Mail - * @version $Revision: 294747 $ + * @version $Revision$ */ class Mail_smtp extends Mail { @@ -162,6 +162,8 @@ class Mail_smtp extends Mail { * @var bool */ var $pipelining; + + var $socket_options = array(); /** * Constructor. @@ -186,9 +188,8 @@ class Mail_smtp extends Mail { * * @param array Hash containing any parameters different from the * defaults. - * @access public */ - function Mail_smtp($params) + public function __construct($params) { if (isset($params['host'])) $this->host = $params['host']; if (isset($params['port'])) $this->port = $params['port']; @@ -200,20 +201,18 @@ class Mail_smtp extends Mail { if (isset($params['debug'])) $this->debug = (bool)$params['debug']; if (isset($params['persist'])) $this->persist = (bool)$params['persist']; if (isset($params['pipelining'])) $this->pipelining = (bool)$params['pipelining']; - + if (isset($params['socket_options'])) $this->socket_options = $params['socket_options']; // Deprecated options if (isset($params['verp'])) { $this->addServiceExtensionParameter('XVERP', is_bool($params['verp']) ? null : $params['verp']); } - - register_shutdown_function(array(&$this, '_Mail_smtp')); } /** * Destructor implementation to ensure that we disconnect from any * potentially-alive persistent SMTP connections. */ - function _Mail_smtp() + public function __destruct() { $this->disconnect(); } @@ -240,12 +239,11 @@ class Mail_smtp extends Mail { * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * @access public */ - function send($recipients, $headers, $body) + public function send($recipients, $headers, $body) { /* If we don't already have an SMTP object, create one. */ - $result = &$this->getSMTPObject(); + $result = $this->getSMTPObject(); if (PEAR::isError($result)) { return $result; } @@ -304,7 +302,7 @@ class Mail_smtp extends Mail { } /* Send the message's headers and the body as SMTP data. */ - $res = $this->_smtp->data($textHeaders . "\r\n\r\n" . $body); + $res = $this->_smtp->data($body, $textHeaders); list(,$args) = $this->_smtp->getResponse(); if (preg_match("/Ok: queued as (.*)/", $args, $queued)) { @@ -337,18 +335,20 @@ class Mail_smtp extends Mail { * failure. * * @since 1.2.0 - * @access public */ - function &getSMTPObject() + public function getSMTPObject() { if (is_object($this->_smtp) !== false) { return $this->_smtp; } include_once 'Net/SMTP.php'; - $this->_smtp = &new Net_SMTP($this->host, + $this->_smtp = new Net_SMTP($this->host, $this->port, - $this->localhost); + $this->localhost, + $this->pipelining, + 0, + $this->socket_options); /* If we still don't have an SMTP object at this point, fail. */ if (is_object($this->_smtp) === false) { @@ -393,9 +393,8 @@ class Mail_smtp extends Mail { * @param string Any value the keyword needs. * * @since 1.2.0 - * @access public */ - function addServiceExtensionParameter($keyword, $value = null) + public function addServiceExtensionParameter($keyword, $value = null) { $this->_extparams[$keyword] = $value; } @@ -406,9 +405,8 @@ class Mail_smtp extends Mail { * @return boolean True if the SMTP connection no longer exists. * * @since 1.1.9 - * @access public */ - function disconnect() + public function disconnect() { /* If we have an SMTP object, disconnect and destroy it. */ if (is_object($this->_smtp) && $this->_smtp->disconnect()) { @@ -428,9 +426,8 @@ class Mail_smtp extends Mail { * @return string A string describing the current SMTP error. * * @since 1.1.7 - * @access private */ - function _error($text, &$error) + protected function _error($text, $error) { /* Split the SMTP response into a code and a response string. */ list($code, $response) = $this->_smtp->getResponse(); diff --git a/WEB-INF/lib/pear/Mail/smtpmx.php b/WEB-INF/lib/pear/Mail/smtpmx.php index f0b69408..6eb8bec2 100644 --- a/WEB-INF/lib/pear/Mail/smtpmx.php +++ b/WEB-INF/lib/pear/Mail/smtpmx.php @@ -1,4 +1,4 @@ - * @copyright 2010 gERD Schaufelberger * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: smtpmx.php 294747 2010-02-08 08:18:33Z clockwerx $ + * @version CVS: $Id$ * @link http://pear.php.net/package/Mail/ */ @@ -56,7 +56,7 @@ require_once 'Net/SMTP.php'; * @access public * @author gERD Schaufelberger * @package Mail - * @version $Revision: 294747 $ + * @version $Revision$ */ class Mail_smtpmx extends Mail { @@ -386,7 +386,7 @@ class Mail_smtpmx extends Mail { } // Send data - $res = $this->_smtp->data("$textHeaders\r\n$body"); + $res = $this->_smtp->data($body, $textHeaders); if (is_a($res, 'PEAR_Error')) { $info = array('rcpt' => $rcpt); return $this->_raiseError('failed_send_data', $info); diff --git a/WEB-INF/lib/pear/Net/SMTP.php b/WEB-INF/lib/pear/Net/SMTP.php index ea4b55e8..dd822a56 100644 --- a/WEB-INF/lib/pear/Net/SMTP.php +++ b/WEB-INF/lib/pear/Net/SMTP.php @@ -1,14 +1,14 @@ | // | Damian Alejandro Fernandez Sosa | // +----------------------------------------------------------------------+ -// -// $Id: SMTP.php 293948 2010-01-24 21:46:00Z jon $ require_once 'PEAR.php'; require_once 'Net/Socket.php'; /** * Provides an implementation of the SMTP protocol using PEAR's - * Net_Socket:: class. + * Net_Socket class. * * @package Net_SMTP * @author Chuck Hagenbuch * @author Jon Parise * @author Damian Alejandro Fernandez Sosa * - * @example basic.php A basic implementation of the Net_SMTP package. + * @example basic.php A basic implementation of the Net_SMTP package. */ class Net_SMTP { /** * The server to connect to. * @var string - * @access public */ - var $host = 'localhost'; + public $host = 'localhost'; /** * The port to connect to. * @var int - * @access public */ - var $port = 25; + public $port = 25; /** * The value to give when sending EHLO or HELO. * @var string - * @access public */ - var $localhost = 'localhost'; + public $localhost = 'localhost'; /** * List of supported authentication methods, in preferential order. * @var array - * @access public */ - var $auth_methods = array('DIGEST-MD5', 'CRAM-MD5', 'LOGIN', 'PLAIN'); + public $auth_methods = array(); /** * Use SMTP command pipelining (specified in RFC 2920) if the SMTP @@ -73,65 +67,69 @@ class Net_SMTP * SMTP server but return immediately. * * @var bool - * @access public */ - var $pipelining = false; + public $pipelining = false; /** * Number of pipelined commands. * @var int - * @access private */ - var $_pipelined_commands = 0; + protected $pipelined_commands = 0; /** * Should debugging output be enabled? * @var boolean - * @access private */ - var $_debug = false; + protected $debug = false; /** * Debug output handler. * @var callback - * @access private */ - var $_debug_handler = null; + protected $debug_handler = null; /** * The socket resource being used to connect to the SMTP server. * @var resource - * @access private */ - var $_socket = null; + protected $socket = null; + + /** + * Array of socket options that will be passed to Net_Socket::connect(). + * @see stream_context_create() + * @var array + */ + protected $socket_options = null; + + /** + * The socket I/O timeout value in seconds. + * @var int + */ + protected $timeout = 0; /** * The most recent server response code. * @var int - * @access private */ - var $_code = -1; + protected $code = -1; /** * The most recent server response arguments. * @var array - * @access private */ - var $_arguments = array(); + protected $arguments = array(); /** * Stores the SMTP server's greeting string. * @var string - * @access private */ - var $_greeting = null; + protected $greeting = null; /** * Stores detected features of the SMTP server. * @var array - * @access private */ - var $_esmtp = array(); + protected $esmtp = array(); /** * Instantiates a new Net_SMTP object, overriding any defaults @@ -144,16 +142,18 @@ class Net_SMTP * $smtp = new Net_SMTP('ssl://mail.host.com', 465); * $smtp->connect(); * - * @param string $host The server to connect to. - * @param integer $port The port to connect to. - * @param string $localhost The value to give when sending EHLO or HELO. - * @param boolean $pipeling Use SMTP command pipelining + * @param string $host The server to connect to. + * @param integer $port The port to connect to. + * @param string $localhost The value to give when sending EHLO or HELO. + * @param boolean $pipelining Use SMTP command pipelining + * @param integer $timeout Socket I/O timeout in seconds. + * @param array $socket_options Socket stream_context_create() options. * - * @access public - * @since 1.0 + * @since 1.0 */ - function Net_SMTP($host = null, $port = null, $localhost = null, $pipelining = false) - { + public function __construct($host = null, $port = null, $localhost = null, + $pipelining = false, $timeout = 0, $socket_options = null + ) { if (isset($host)) { $this->host = $host; } @@ -163,49 +163,65 @@ class Net_SMTP if (isset($localhost)) { $this->localhost = $localhost; } - $this->pipelining = $pipelining; - $this->_socket = new Net_Socket(); + $this->pipelining = $pipelining; + $this->socket = new Net_Socket(); + $this->socket_options = $socket_options; + $this->timeout = $timeout; - /* Include the Auth_SASL package. If the package is not - * available, we disable the authentication methods that - * depend upon it. */ - if ((@include_once 'Auth/SASL.php') === false) { - $pos = array_search('DIGEST-MD5', $this->auth_methods); - unset($this->auth_methods[$pos]); - $pos = array_search('CRAM-MD5', $this->auth_methods); - unset($this->auth_methods[$pos]); + /* Include the Auth_SASL package. If the package is available, we + * enable the authentication methods that depend upon it. */ + if (@include_once 'Auth/SASL.php') { + $this->setAuthMethod('CRAM-MD5', array($this, 'authCramMD5')); + $this->setAuthMethod('DIGEST-MD5', array($this, 'authDigestMD5')); } + + /* These standard authentication methods are always available. */ + $this->setAuthMethod('LOGIN', array($this, 'authLogin'), false); + $this->setAuthMethod('PLAIN', array($this, 'authPlain'), false); + } + + /** + * Set the socket I/O timeout value in seconds plus microseconds. + * + * @param integer $seconds Timeout value in seconds. + * @param integer $microseconds Additional value in microseconds. + * + * @since 1.5.0 + */ + public function setTimeout($seconds, $microseconds = 0) + { + return $this->socket->setTimeout($seconds, $microseconds); } /** * Set the value of the debugging flag. * - * @param boolean $debug New value for the debugging flag. + * @param boolean $debug New value for the debugging flag. + * @param callback $handler Debug handler callback * - * @access public - * @since 1.1.0 + * @since 1.1.0 */ - function setDebug($debug, $handler = null) + public function setDebug($debug, $handler = null) { - $this->_debug = $debug; - $this->_debug_handler = $handler; + $this->debug = $debug; + $this->debug_handler = $handler; } /** * Write the given debug text to the current debug output handler. * - * @param string $message Debug mesage text. + * @param string $message Debug mesage text. * - * @access private - * @since 1.3.3 + * @since 1.3.3 */ - function _debug($message) + protected function debug($message) { - if ($this->_debug) { - if ($this->_debug_handler) { - call_user_func_array($this->_debug_handler, - array(&$this, $message)); + if ($this->debug) { + if ($this->debug_handler) { + call_user_func_array( + $this->debug_handler, array(&$this, $message) + ); } else { echo "DEBUG: $message\n"; } @@ -215,24 +231,24 @@ class Net_SMTP /** * Send the given string of data to the server. * - * @param string $data The string of data to send. + * @param string $data The string of data to send. * - * @return mixed True on success or a PEAR_Error object on failure. + * @return mixed The number of bytes that were actually written, + * or a PEAR_Error object on failure. * - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _send($data) + protected function send($data) { - $this->_debug("Send: $data"); + $this->debug("Send: $data"); - $error = $this->_socket->write($data); - if ($error === false || PEAR::isError($error)) { - $msg = ($error) ? $error->getMessage() : "unknown error"; + $result = $this->socket->write($data); + if (!$result || PEAR::isError($result)) { + $msg = $result ? $result->getMessage() : "unknown error"; return PEAR::raiseError("Failed to write to socket: $msg"); } - return true; + return $result; } /** @@ -240,19 +256,18 @@ class Net_SMTP * arguments. A carriage return / linefeed (CRLF) sequence will * be appended to each command string before it is sent to the * SMTP server - an error will be thrown if the command string - * already contains any newline characters. Use _send() for + * already contains any newline characters. Use send() for * commands that must contain newlines. * - * @param string $command The SMTP command to send to the server. - * @param string $args A string of optional arguments to append - * to the command. + * @param string $command The SMTP command to send to the server. + * @param string $args A string of optional arguments to append + * to the command. * - * @return mixed The result of the _send() call. + * @return mixed The result of the send() call. * - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _put($command, $args = '') + protected function put($command, $args = '') { if (!empty($args)) { $command .= ' ' . $args; @@ -262,57 +277,56 @@ class Net_SMTP return PEAR::raiseError('Commands cannot contain newlines'); } - return $this->_send($command . "\r\n"); + return $this->send($command . "\r\n"); } /** * Read a reply from the SMTP server. The reply consists of a response * code and a response message. * - * @param mixed $valid The set of valid response codes. These - * may be specified as an array of integer - * values or as a single integer value. - * @param bool $later Do not parse the response now, but wait - * until the last command in the pipelined - * command group + * @param mixed $valid The set of valid response codes. These + * may be specified as an array of integer + * values or as a single integer value. + * @param bool $later Do not parse the response now, but wait + * until the last command in the pipelined + * command group * - * @return mixed True if the server returned a valid response code or - * a PEAR_Error object is an error condition is reached. + * @return mixed True if the server returned a valid response code or + * a PEAR_Error object is an error condition is reached. * - * @access private - * @since 1.1.0 + * @since 1.1.0 * - * @see getResponse + * @see getResponse */ - function _parseResponse($valid, $later = false) + protected function parseResponse($valid, $later = false) { - $this->_code = -1; - $this->_arguments = array(); + $this->code = -1; + $this->arguments = array(); if ($later) { - $this->_pipelined_commands++; + $this->pipelined_commands++; return true; } - for ($i = 0; $i <= $this->_pipelined_commands; $i++) { - while ($line = $this->_socket->readLine()) { - $this->_debug("Recv: $line"); + for ($i = 0; $i <= $this->pipelined_commands; $i++) { + while ($line = $this->socket->readLine()) { + $this->debug("Recv: $line"); - /* If we receive an empty line, the connection has been closed. */ + /* If we receive an empty line, the connection was closed. */ if (empty($line)) { $this->disconnect(); - return PEAR::raiseError('Connection was unexpectedly closed'); + return PEAR::raiseError('Connection was closed'); } /* Read the code and store the rest in the arguments array. */ $code = substr($line, 0, 3); - $this->_arguments[] = trim(substr($line, 4)); + $this->arguments[] = trim(substr($line, 4)); /* Check the syntax of the response code. */ if (is_numeric($code)) { - $this->_code = (int)$code; + $this->code = (int)$code; } else { - $this->_code = -1; + $this->code = -1; break; } @@ -323,79 +337,115 @@ class Net_SMTP } } - $this->_pipelined_commands = 0; + $this->pipelined_commands = 0; /* Compare the server's response code with the valid code/codes. */ - if (is_int($valid) && ($this->_code === $valid)) { + if (is_int($valid) && ($this->code === $valid)) { return true; - } elseif (is_array($valid) && in_array($this->_code, $valid, true)) { + } elseif (is_array($valid) && in_array($this->code, $valid, true)) { return true; } - return PEAR::raiseError('Invalid response code received from server', - $this->_code); + return PEAR::raiseError('Invalid response code received from server', $this->code); + } + + /** + * Issue an SMTP command and verify its response. + * + * @param string $command The SMTP command string or data. + * @param mixed $valid The set of valid response codes. These + * may be specified as an array of integer + * values or as a single integer value. + * + * @return mixed True on success or a PEAR_Error object on failure. + * + * @since 1.6.0 + */ + public function command($command, $valid) + { + if (PEAR::isError($error = $this->put($command))) { + return $error; + } + if (PEAR::isError($error = $this->parseResponse($valid))) { + return $error; + } + + return true; } /** * Return a 2-tuple containing the last response from the SMTP server. * - * @return array A two-element array: the first element contains the - * response code as an integer and the second element - * contains the response's arguments as a string. + * @return array A two-element array: the first element contains the + * response code as an integer and the second element + * contains the response's arguments as a string. * - * @access public - * @since 1.1.0 + * @since 1.1.0 */ - function getResponse() + public function getResponse() { - return array($this->_code, join("\n", $this->_arguments)); + return array($this->code, join("\n", $this->arguments)); } /** * Return the SMTP server's greeting string. * - * @return string A string containing the greeting string, or null if a - * greeting has not been received. + * @return string A string containing the greeting string, or null if + * a greeting has not been received. * - * @access public - * @since 1.3.3 + * @since 1.3.3 */ - function getGreeting() + public function getGreeting() { - return $this->_greeting; + return $this->greeting; } /** * Attempt to connect to the SMTP server. * - * @param int $timeout The timeout value (in seconds) for the - * socket connection. - * @param bool $persistent Should a persistent socket connection - * be used? + * @param int $timeout The timeout value (in seconds) for the + * socket connection attempt. + * @param bool $persistent Should a persistent socket connection + * be used? * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function connect($timeout = null, $persistent = false) + public function connect($timeout = null, $persistent = false) { - $this->_greeting = null; - $result = $this->_socket->connect($this->host, $this->port, - $persistent, $timeout); + $this->greeting = null; + + $result = $this->socket->connect( + $this->host, $this->port, $persistent, $timeout, $this->socket_options + ); + if (PEAR::isError($result)) { - return PEAR::raiseError('Failed to connect socket: ' . - $result->getMessage()); + return PEAR::raiseError( + 'Failed to connect socket: ' . $result->getMessage() + ); + } + + /* + * Now that we're connected, reset the socket's timeout value for + * future I/O operations. This allows us to have different socket + * timeout values for the initial connection (our $timeout parameter) + * and all other socket operations. + */ + if ($this->timeout > 0) { + if (PEAR::isError($error = $this->setTimeout($this->timeout))) { + return $error; + } } - if (PEAR::isError($error = $this->_parseResponse(220))) { + if (PEAR::isError($error = $this->parseResponse(220))) { return $error; } /* Extract and store a copy of the server's greeting string. */ - list(, $this->_greeting) = $this->getResponse(); + list(, $this->greeting) = $this->getResponse(); - if (PEAR::isError($error = $this->_negotiate())) { + if (PEAR::isError($error = $this->negotiate())) { return $error; } @@ -407,20 +457,20 @@ class Net_SMTP * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function disconnect() + public function disconnect() { - if (PEAR::isError($error = $this->_put('QUIT'))) { + if (PEAR::isError($error = $this->put('QUIT'))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(221))) { + if (PEAR::isError($error = $this->parseResponse(221))) { return $error; } - if (PEAR::isError($error = $this->_socket->disconnect())) { - return PEAR::raiseError('Failed to disconnect socket: ' . - $error->getMessage()); + if (PEAR::isError($error = $this->socket->disconnect())) { + return PEAR::raiseError( + 'Failed to disconnect socket: ' . $error->getMessage() + ); } return true; @@ -433,40 +483,34 @@ class Net_SMTP * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. * - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _negotiate() + protected function negotiate() { - if (PEAR::isError($error = $this->_put('EHLO', $this->localhost))) { + if (PEAR::isError($error = $this->put('EHLO', $this->localhost))) { return $error; } - if (PEAR::isError($this->_parseResponse(250))) { - /* If we receive a 503 response, we're already authenticated. */ - if ($this->_code === 503) { - return true; - } - + if (PEAR::isError($this->parseResponse(250))) { /* If the EHLO failed, try the simpler HELO command. */ - if (PEAR::isError($error = $this->_put('HELO', $this->localhost))) { + if (PEAR::isError($error = $this->put('HELO', $this->localhost))) { return $error; } - if (PEAR::isError($this->_parseResponse(250))) { - return PEAR::raiseError('HELO was not accepted: ', $this->_code); + if (PEAR::isError($this->parseResponse(250))) { + return PEAR::raiseError('HELO was not accepted', $this->code); } return true; } - foreach ($this->_arguments as $argument) { - $verb = strtok($argument, ' '); - $arguments = substr($argument, strlen($verb) + 1, - strlen($argument) - strlen($verb) - 1); - $this->_esmtp[$verb] = $arguments; + foreach ($this->arguments as $argument) { + $verb = strtok($argument, ' '); + $len = strlen($verb); + $arguments = substr($argument, $len + 1, strlen($argument) - $len - 1); + $this->esmtp[$verb] = $arguments; } - if (!isset($this->_esmtp['PIPELINING'])) { + if (!isset($this->esmtp['PIPELINING'])) { $this->pipelining = false; } @@ -477,17 +521,16 @@ class Net_SMTP * Returns the name of the best authentication method that the server * has advertised. * - * @return mixed Returns a string containing the name of the best - * supported authentication method or a PEAR_Error object - * if a failure condition is encountered. - * @access private - * @since 1.1.0 + * @return mixed Returns a string containing the name of the best + * supported authentication method or a PEAR_Error object + * if a failure condition is encountered. + * @since 1.1.0 */ - function _getBestAuthMethod() + protected function getBestAuthMethod() { - $available_methods = explode(' ', $this->_esmtp['AUTH']); + $available_methods = explode(' ', $this->esmtp['AUTH']); - foreach ($this->auth_methods as $method) { + foreach ($this->auth_methods as $method => $callback) { if (in_array($method, $available_methods)) { return $method; } @@ -499,35 +542,47 @@ class Net_SMTP /** * Attempt to do SMTP authentication. * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. - * @param string The requested authentication method. If none is - * specified, the best supported method will be used. - * @param bool Flag indicating whether or not TLS should be attempted. + * @param string $uid The userid to authenticate as. + * @param string $pwd The password to authenticate with. + * @param string $method The requested authentication method. If none is + * specified, the best supported method will be used. + * @param bool $tls Flag indicating whether or not TLS should be attempted. + * @param string $authz An optional authorization identifier. If specified, this + * identifier will be used as the authorization proxy. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function auth($uid, $pwd , $method = '', $tls = true) + public function auth($uid, $pwd , $method = '', $tls = true, $authz = '') { /* We can only attempt a TLS connection if one has been requested, - * we're running PHP 5.1.0 or later, have access to the OpenSSL - * extension, are connected to an SMTP server which supports the - * STARTTLS extension, and aren't already connected over a secure + * we're running PHP 5.1.0 or later, have access to the OpenSSL + * extension, are connected to an SMTP server which supports the + * STARTTLS extension, and aren't already connected over a secure * (SSL) socket connection. */ - if ($tls && version_compare(PHP_VERSION, '5.1.0', '>=') && - extension_loaded('openssl') && isset($this->_esmtp['STARTTLS']) && - strncasecmp($this->host, 'ssl://', 6) !== 0) { + if ($tls && version_compare(PHP_VERSION, '5.1.0', '>=') + && extension_loaded('openssl') && isset($this->esmtp['STARTTLS']) + && strncasecmp($this->host, 'ssl://', 6) !== 0 + ) { /* Start the TLS connection attempt. */ - if (PEAR::isError($result = $this->_put('STARTTLS'))) { + if (PEAR::isError($result = $this->put('STARTTLS'))) { return $result; } - if (PEAR::isError($result = $this->_parseResponse(220))) { + if (PEAR::isError($result = $this->parseResponse(220))) { return $result; } - if (PEAR::isError($result = $this->_socket->enableCrypto(true, STREAM_CRYPTO_METHOD_TLS_CLIENT))) { + if (isset($this->socket_options['ssl']['crypto_method'])) { + $crypto_method = $this->socket_options['ssl']['crypto_method']; + } else { + /* STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT constant does not exist + * and STREAM_CRYPTO_METHOD_SSLv23_CLIENT constant is + * inconsistent across PHP versions. */ + $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT + | @STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT + | @STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; + } + if (PEAR::isError($result = $this->socket->enableCrypto(true, $crypto_method))) { return $result; } elseif ($result !== true) { return PEAR::raiseError('STARTTLS failed'); @@ -535,47 +590,41 @@ class Net_SMTP /* Send EHLO again to recieve the AUTH string from the * SMTP server. */ - $this->_negotiate(); + $this->negotiate(); } - if (empty($this->_esmtp['AUTH'])) { + if (empty($this->esmtp['AUTH'])) { return PEAR::raiseError('SMTP server does not support authentication'); } /* If no method has been specified, get the name of the best * supported method advertised by the SMTP server. */ if (empty($method)) { - if (PEAR::isError($method = $this->_getBestAuthMethod())) { + if (PEAR::isError($method = $this->getBestAuthMethod())) { /* Return the PEAR_Error object from _getBestAuthMethod(). */ return $method; } } else { $method = strtoupper($method); - if (!in_array($method, $this->auth_methods)) { + if (!array_key_exists($method, $this->auth_methods)) { return PEAR::raiseError("$method is not a supported authentication method"); } } - switch ($method) { - case 'DIGEST-MD5': - $result = $this->_authDigest_MD5($uid, $pwd); - break; - - case 'CRAM-MD5': - $result = $this->_authCRAM_MD5($uid, $pwd); - break; - - case 'LOGIN': - $result = $this->_authLogin($uid, $pwd); - break; + if (!isset($this->auth_methods[$method])) { + return PEAR::raiseError("$method is not a supported authentication method"); + } - case 'PLAIN': - $result = $this->_authPlain($uid, $pwd); - break; + if (!is_callable($this->auth_methods[$method], false)) { + return PEAR::raiseError("$method authentication method cannot be called"); + } - default: - $result = PEAR::raiseError("$method is not a supported authentication method"); - break; + if (is_array($this->auth_methods[$method])) { + list($object, $method) = $this->auth_methods[$method]; + $result = $object->{$method}($uid, $pwd, $authz, $this); + } else { + $func = $this->auth_methods[$method]; + $result = $func($uid, $pwd, $authz, $this); } /* If an error was encountered, return the PEAR_Error object. */ @@ -586,52 +635,94 @@ class Net_SMTP return true; } + /** + * Add a new authentication method. + * + * @param string $name The authentication method name (e.g. 'PLAIN') + * @param mixed $callback The authentication callback (given as the name of a + * function or as an (object, method name) array). + * @param bool $prepend Should the new method be prepended to the list of + * available methods? This is the default behavior, + * giving the new method the highest priority. + * + * @return mixed True on success or a PEAR_Error object on failure. + * + * @since 1.6.0 + */ + public function setAuthMethod($name, $callback, $prepend = true) + { + if (!is_string($name)) { + return PEAR::raiseError('Method name is not a string'); + } + + if (!is_string($callback) && !is_array($callback)) { + return PEAR::raiseError('Method callback must be string or array'); + } + + if (is_array($callback)) { + if (!is_object($callback[0]) || !is_string($callback[1])) { + return PEAR::raiseError('Bad mMethod callback array'); + } + } + + if ($prepend) { + $this->auth_methods = array_merge( + array($name => $callback), $this->auth_methods + ); + } else { + $this->auth_methods[$name] = $callback; + } + + return true; + } + /** * Authenticates the user using the DIGEST-MD5 method. * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. + * @param string $uid The userid to authenticate as. + * @param string $pwd The password to authenticate with. + * @param string $authz The optional authorization proxy identifier. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _authDigest_MD5($uid, $pwd) + protected function authDigestMD5($uid, $pwd, $authz = '') { - if (PEAR::isError($error = $this->_put('AUTH', 'DIGEST-MD5'))) { + if (PEAR::isError($error = $this->put('AUTH', 'DIGEST-MD5'))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { /* 503: Error: already authenticated */ - if ($this->_code === 503) { + if ($this->code === 503) { return true; } return $error; } - $challenge = base64_decode($this->_arguments[0]); - $digest = &Auth_SASL::factory('digestmd5'); - $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, - $this->host, "smtp")); + $digest = Auth_SASL::factory('digest-md5'); + $challenge = base64_decode($this->arguments[0]); + $auth_str = base64_encode( + $digest->getResponse($uid, $pwd, $challenge, $this->host, "smtp", $authz) + ); - if (PEAR::isError($error = $this->_put($auth_str))) { + if (PEAR::isError($error = $this->put($auth_str))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { return $error; } /* We don't use the protocol's third step because SMTP doesn't * allow subsequent authentication, so we just silently ignore * it. */ - if (PEAR::isError($error = $this->_put(''))) { + if (PEAR::isError($error = $this->put(''))) { return $error; } /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { + if (PEAR::isError($error = $this->parseResponse(235))) { return $error; } } @@ -639,38 +730,38 @@ class Net_SMTP /** * Authenticates the user using the CRAM-MD5 method. * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. + * @param string $uid The userid to authenticate as. + * @param string $pwd The password to authenticate with. + * @param string $authz The optional authorization proxy identifier. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _authCRAM_MD5($uid, $pwd) + protected function authCRAMMD5($uid, $pwd, $authz = '') { - if (PEAR::isError($error = $this->_put('AUTH', 'CRAM-MD5'))) { + if (PEAR::isError($error = $this->put('AUTH', 'CRAM-MD5'))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { /* 503: Error: already authenticated */ - if ($this->_code === 503) { + if ($this->code === 503) { return true; } return $error; } - $challenge = base64_decode($this->_arguments[0]); - $cram = &Auth_SASL::factory('crammd5'); - $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge)); + $challenge = base64_decode($this->arguments[0]); + $cram = Auth_SASL::factory('cram-md5'); + $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge)); - if (PEAR::isError($error = $this->_put($auth_str))) { + if (PEAR::isError($error = $this->put($auth_str))) { return $error; } /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { + if (PEAR::isError($error = $this->parseResponse(235))) { return $error; } } @@ -678,42 +769,42 @@ class Net_SMTP /** * Authenticates the user using the LOGIN method. * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. + * @param string $uid The userid to authenticate as. + * @param string $pwd The password to authenticate with. + * @param string $authz The optional authorization proxy identifier. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _authLogin($uid, $pwd) + protected function authLogin($uid, $pwd, $authz = '') { - if (PEAR::isError($error = $this->_put('AUTH', 'LOGIN'))) { + if (PEAR::isError($error = $this->put('AUTH', 'LOGIN'))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { /* 503: Error: already authenticated */ - if ($this->_code === 503) { + if ($this->code === 503) { return true; } return $error; } - if (PEAR::isError($error = $this->_put(base64_encode($uid)))) { + if (PEAR::isError($error = $this->put(base64_encode($uid)))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { return $error; } - if (PEAR::isError($error = $this->_put(base64_encode($pwd)))) { + if (PEAR::isError($error = $this->put(base64_encode($pwd)))) { return $error; } /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { + if (PEAR::isError($error = $this->parseResponse(235))) { return $error; } @@ -723,36 +814,36 @@ class Net_SMTP /** * Authenticates the user using the PLAIN method. * - * @param string The userid to authenticate as. - * @param string The password to authenticate with. + * @param string $uid The userid to authenticate as. + * @param string $pwd The password to authenticate with. + * @param string $authz The optional authorization proxy identifier. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access private - * @since 1.1.0 + * @since 1.1.0 */ - function _authPlain($uid, $pwd) + protected function authPlain($uid, $pwd, $authz = '') { - if (PEAR::isError($error = $this->_put('AUTH', 'PLAIN'))) { + if (PEAR::isError($error = $this->put('AUTH', 'PLAIN'))) { return $error; } /* 334: Continue authentication request */ - if (PEAR::isError($error = $this->_parseResponse(334))) { + if (PEAR::isError($error = $this->parseResponse(334))) { /* 503: Error: already authenticated */ - if ($this->_code === 503) { + if ($this->code === 503) { return true; } return $error; } - $auth_str = base64_encode(chr(0) . $uid . chr(0) . $pwd); + $auth_str = base64_encode($authz . chr(0) . $uid . chr(0) . $pwd); - if (PEAR::isError($error = $this->_put($auth_str))) { + if (PEAR::isError($error = $this->put($auth_str))) { return $error; } /* 235: Authentication successful */ - if (PEAR::isError($error = $this->_parseResponse(235))) { + if (PEAR::isError($error = $this->parseResponse(235))) { return $error; } @@ -762,19 +853,18 @@ class Net_SMTP /** * Send the HELO command. * - * @param string The domain name to say we are. + * @param string $domain The domain name to say we are. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function helo($domain) + public function helo($domain) { - if (PEAR::isError($error = $this->_put('HELO', $domain))) { + if (PEAR::isError($error = $this->put('HELO', $domain))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250))) { + if (PEAR::isError($error = $this->parseResponse(250))) { return $error; } @@ -785,55 +875,50 @@ class Net_SMTP * Return the list of SMTP service extensions advertised by the server. * * @return array The list of SMTP service extensions. - * @access public * @since 1.3 */ - function getServiceExtensions() + public function getServiceExtensions() { - return $this->_esmtp; + return $this->esmtp; } /** * Send the MAIL FROM: command. * - * @param string $sender The sender (reverse path) to set. - * @param string $params String containing additional MAIL parameters, - * such as the NOTIFY flags defined by RFC 1891 - * or the VERP protocol. + * @param string $sender The sender (reverse path) to set. + * @param string $params String containing additional MAIL parameters, + * such as the NOTIFY flags defined by RFC 1891 + * or the VERP protocol. * - * If $params is an array, only the 'verp' option - * is supported. If 'verp' is true, the XVERP - * parameter is appended to the MAIL command. If - * the 'verp' value is a string, the full - * XVERP=value parameter is appended. + * If $params is an array, only the 'verp' option + * is supported. If 'verp' is true, the XVERP + * parameter is appended to the MAIL command. + * If the 'verp' value is a string, the full + * XVERP=value parameter is appended. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function mailFrom($sender, $params = null) + public function mailFrom($sender, $params = null) { $args = "FROM:<$sender>"; /* Support the deprecated array form of $params. */ if (is_array($params) && isset($params['verp'])) { - /* XVERP */ if ($params['verp'] === true) { $args .= ' XVERP'; - - /* XVERP=something */ } elseif (trim($params['verp'])) { $args .= ' XVERP=' . $params['verp']; } - } elseif (is_string($params)) { + } elseif (is_string($params) && !empty($params)) { $args .= ' ' . $params; } - if (PEAR::isError($error = $this->_put('MAIL', $args))) { + if (PEAR::isError($error = $this->put('MAIL', $args))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } @@ -850,20 +935,19 @@ class Net_SMTP * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. * - * @access public - * @since 1.0 + * @since 1.0 */ - function rcptTo($recipient, $params = null) + public function rcptTo($recipient, $params = null) { $args = "TO:<$recipient>"; if (is_string($params)) { $args .= ' ' . $params; } - if (PEAR::isError($error = $this->_put('RCPT', $args))) { + if (PEAR::isError($error = $this->put('RCPT', $args))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(array(250, 251), $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(array(250, 251), $this->pipelining))) { return $error; } @@ -877,114 +961,155 @@ class Net_SMTP * easier overloading for the cases where it is desirable to * customize the quoting behavior. * - * @param string $data The message text to quote. The string must be passed + * @param string &$data The message text to quote. The string must be passed * by reference, and the text will be modified in place. * - * @access public - * @since 1.2 + * @since 1.2 */ - function quotedata(&$data) + public function quotedata(&$data) { - /* Change Unix (\n) and Mac (\r) linefeeds into - * Internet-standard CRLF (\r\n) linefeeds. */ - $data = preg_replace(array('/(?_esmtp['SIZE']) && ($this->_esmtp['SIZE'] > 0)) { - /* Start by considering the size of the optional headers string. - * We also account for the addition 4 character "\r\n\r\n" - * separator sequence. */ - $size = (is_null($headers)) ? 0 : strlen($headers) + 4; - - if (is_resource($data)) { - $stat = fstat($data); - if ($stat === false) { - return PEAR::raiseError('Failed to get file size'); - } - $size += $stat['size']; - } else { - $size += strlen($data); - } + /* Start by considering the size of the optional headers string. We + * also account for the addition 4 character "\r\n\r\n" separator + * sequence. */ + $size = (is_null($headers)) ? 0 : strlen($headers) + 4; - if ($size >= $this->_esmtp['SIZE']) { - $this->disconnect(); - return PEAR::raiseError('Message size exceeds server limit'); + if (is_resource($data)) { + $stat = fstat($data); + if ($stat === false) { + return PEAR::raiseError('Failed to get file size'); } + $size += $stat['size']; + } else { + $size += strlen($data); + } + + /* RFC 1870, section 3, subsection 3 states "a value of zero indicates + * that no fixed maximum message size is in force". Furthermore, it + * says that if "the parameter is omitted no information is conveyed + * about the server's fixed maximum message size". */ + $limit = (isset($this->esmtp['SIZE'])) ? $this->esmtp['SIZE'] : 0; + if ($limit > 0 && $size >= $limit) { + $this->disconnect(); + return PEAR::raiseError('Message size exceeds server limit'); } /* Initiate the DATA command. */ - if (PEAR::isError($error = $this->_put('DATA'))) { + if (PEAR::isError($error = $this->put('DATA'))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(354))) { + if (PEAR::isError($error = $this->parseResponse(354))) { return $error; } /* If we have a separate headers string, send it first. */ if (!is_null($headers)) { $this->quotedata($headers); - if (PEAR::isError($result = $this->_send($headers . "\r\n\r\n"))) { + if (PEAR::isError($result = $this->send($headers . "\r\n\r\n"))) { return $result; } + + /* Subtract the headers size now that they've been sent. */ + $size -= strlen($headers) + 4; } /* Now we can send the message body data. */ if (is_resource($data)) { - /* Stream the contents of the file resource out over our socket - * connection, line by line. Each line must be run through the + /* Stream the contents of the file resource out over our socket + * connection, line by line. Each line must be run through the * quoting routine. */ - while ($line = fgets($data, 1024)) { + while (strlen($line = fread($data, 8192)) > 0) { + /* If the last character is an newline, we need to grab the + * next character to check to see if it is a period. */ + while (!feof($data)) { + $char = fread($data, 1); + $line .= $char; + if ($char != "\n") { + break; + } + } $this->quotedata($line); - if (PEAR::isError($result = $this->_send($line))) { + if (PEAR::isError($result = $this->send($line))) { return $result; } } - /* Finally, send the DATA terminator sequence. */ - if (PEAR::isError($result = $this->_send("\r\n.\r\n"))) { - return $result; - } + $last = $line; } else { - /* Just send the entire quoted string followed by the DATA - * terminator. */ - $this->quotedata($data); - if (PEAR::isError($result = $this->_send($data . "\r\n.\r\n"))) { - return $result; + /* + * Break up the data by sending one chunk (up to 512k) at a time. + * This approach reduces our peak memory usage. + */ + for ($offset = 0; $offset < $size;) { + $end = $offset + 512000; + + /* + * Ensure we don't read beyond our data size or span multiple + * lines. quotedata() can't properly handle character data + * that's split across two line break boundaries. + */ + if ($end >= $size) { + $end = $size; + } else { + for (; $end < $size; $end++) { + if ($data[$end] != "\n") { + break; + } + } + } + + /* Extract our chunk and run it through the quoting routine. */ + $chunk = substr($data, $offset, $end - $offset); + $this->quotedata($chunk); + + /* If we run into a problem along the way, abort. */ + if (PEAR::isError($result = $this->send($chunk))) { + return $result; + } + + /* Advance the offset to the end of this chunk. */ + $offset = $end; } + + $last = $chunk; + } + + /* Don't add another CRLF sequence if it's already in the data */ + $terminator = (substr($last, -2) == "\r\n" ? '' : "\r\n") . ".\r\n"; + + /* Finally, send the DATA terminator sequence. */ + if (PEAR::isError($result = $this->send($terminator))) { + return $result; } /* Verify that the data was successfully received by the server. */ - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } @@ -994,134 +1119,79 @@ class Net_SMTP /** * Send the SEND FROM: command. * - * @param string The reverse path to send. + * @param string $path The reverse path to send. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.2.6 + * @since 1.2.6 */ - function sendFrom($path) + public function sendFrom($path) { - if (PEAR::isError($error = $this->_put('SEND', "FROM:<$path>"))) { + if (PEAR::isError($error = $this->put('SEND', "FROM:<$path>"))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } return true; } - /** - * Backwards-compatibility wrapper for sendFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @access public - * @since 1.0 - * @deprecated 1.2.6 - */ - function send_from($path) - { - return sendFrom($path); - } - /** * Send the SOML FROM: command. * - * @param string The reverse path to send. + * @param string $path The reverse path to send. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.2.6 + * @since 1.2.6 */ - function somlFrom($path) + public function somlFrom($path) { - if (PEAR::isError($error = $this->_put('SOML', "FROM:<$path>"))) { + if (PEAR::isError($error = $this->put('SOML', "FROM:<$path>"))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } return true; } - /** - * Backwards-compatibility wrapper for somlFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @access public - * @since 1.0 - * @deprecated 1.2.6 - */ - function soml_from($path) - { - return somlFrom($path); - } - /** * Send the SAML FROM: command. * - * @param string The reverse path to send. + * @param string $path The reverse path to send. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.2.6 + * @since 1.2.6 */ - function samlFrom($path) + public function samlFrom($path) { - if (PEAR::isError($error = $this->_put('SAML', "FROM:<$path>"))) { + if (PEAR::isError($error = $this->put('SAML', "FROM:<$path>"))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } return true; } - /** - * Backwards-compatibility wrapper for samlFrom(). - * - * @param string The reverse path to send. - * - * @return mixed Returns a PEAR_Error with an error message on any - * kind of failure, or true on success. - * - * @access public - * @since 1.0 - * @deprecated 1.2.6 - */ - function saml_from($path) - { - return samlFrom($path); - } - /** * Send the RSET command. * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public * @since 1.0 */ - function rset() + public function rset() { - if (PEAR::isError($error = $this->_put('RSET'))) { + if (PEAR::isError($error = $this->put('RSET'))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250, $this->pipelining))) { + if (PEAR::isError($error = $this->parseResponse(250, $this->pipelining))) { return $error; } @@ -1131,20 +1201,19 @@ class Net_SMTP /** * Send the VRFY command. * - * @param string The string to verify + * @param string $string The string to verify * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function vrfy($string) + public function vrfy($string) { /* Note: 251 is also a valid response code */ - if (PEAR::isError($error = $this->_put('VRFY', $string))) { + if (PEAR::isError($error = $this->put('VRFY', $string))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(array(250, 252)))) { + if (PEAR::isError($error = $this->parseResponse(array(250, 252)))) { return $error; } @@ -1156,15 +1225,14 @@ class Net_SMTP * * @return mixed Returns a PEAR_Error with an error message on any * kind of failure, or true on success. - * @access public - * @since 1.0 + * @since 1.0 */ - function noop() + public function noop() { - if (PEAR::isError($error = $this->_put('NOOP'))) { + if (PEAR::isError($error = $this->put('NOOP'))) { return $error; } - if (PEAR::isError($error = $this->_parseResponse(250))) { + if (PEAR::isError($error = $this->parseResponse(250))) { return $error; } @@ -1175,14 +1243,12 @@ class Net_SMTP * Backwards-compatibility method. identifySender()'s functionality is * now handled internally. * - * @return boolean This method always return true. + * @return boolean This method always return true. * - * @access public - * @since 1.0 + * @since 1.0 */ - function identifySender() + public function identifySender() { return true; } - } diff --git a/WEB-INF/lib/pear/Net/Socket.php b/WEB-INF/lib/pear/Net/Socket.php index 73bb4dd1..bf1d1bbc 100644 --- a/WEB-INF/lib/pear/Net/Socket.php +++ b/WEB-INF/lib/pear/Net/Socket.php @@ -1,39 +1,50 @@ | -// | Chuck Hagenbuch | -// +----------------------------------------------------------------------+ -// -// $Id: Socket.php,v 1.38 2008/02/15 18:24:17 chagenbu Exp $ +/** + * Net_Socket + * + * PHP Version 4 + * + * Copyright (c) 1997-2013 The PHP Group + * + * This source file is subject to version 2.0 of the PHP license, + * that is bundled with this package in the file LICENSE, and is + * available at through the world-wide-web at + * http://www.php.net/license/2_02.txt. + * If you did not receive a copy of the PHP license and are unable to + * obtain it through the world-wide-web, please send a note to + * license@php.net so we can mail you a copy immediately. + * + * Authors: Stig Bakken + * Chuck Hagenbuch + * + * @category Net + * @package Net_Socket + * @author Stig Bakken + * @author Chuck Hagenbuch + * @copyright 1997-2003 The PHP Group + * @license http://www.php.net/license/2_02.txt PHP 2.02 + * @link http://pear.php.net/packages/Net_Socket + */ require_once 'PEAR.php'; -define('NET_SOCKET_READ', 1); +define('NET_SOCKET_READ', 1); define('NET_SOCKET_WRITE', 2); define('NET_SOCKET_ERROR', 4); /** * Generalized Socket class. * - * @version 1.1 - * @author Stig Bakken - * @author Chuck Hagenbuch + * @category Net + * @package Net_Socket + * @author Stig Bakken + * @author Chuck Hagenbuch + * @copyright 1997-2003 The PHP Group + * @license http://www.php.net/license/2_02.txt PHP 2.02 + * @link http://pear.php.net/packages/Net_Socket */ -class Net_Socket extends PEAR { - +class Net_Socket extends PEAR +{ /** * Socket file pointer. * @var resource $fp @@ -65,11 +76,11 @@ class Net_Socket extends PEAR { var $port = 0; /** - * Number of seconds to wait on socket connections before assuming + * Number of seconds to wait on socket operations before assuming * there's no more data. Defaults to no timeout. - * @var integer $timeout + * @var integer|float $timeout */ - var $timeout = false; + var $timeout = null; /** * Number of bytes to read at a time in readLine() and @@ -78,23 +89,30 @@ class Net_Socket extends PEAR { */ var $lineLength = 2048; + /** + * The string to use as a newline terminator. Usually "\r\n" or "\n". + * @var string $newline + */ + var $newline = "\r\n"; + /** * Connect to the specified port. If called when the socket is * already connected, it disconnects and connects again. * - * @param string $addr IP address or host name. - * @param integer $port TCP port number. - * @param boolean $persistent (optional) Whether the connection is - * persistent (kept open between requests - * by the web server). - * @param integer $timeout (optional) How long to wait for data. - * @param array $options See options for stream_context_create. + * @param string $addr IP address or host name (may be with protocol prefix). + * @param integer $port TCP port number. + * @param boolean $persistent (optional) Whether the connection is + * persistent (kept open between requests + * by the web server). + * @param integer $timeout (optional) Connection socket timeout. + * @param array $options See options for stream_context_create. * * @access public * - * @return boolean | PEAR_Error True on success or a PEAR_Error on failure. + * @return boolean|PEAR_Error True on success or a PEAR_Error on failure. */ - function connect($addr, $port = 0, $persistent = null, $timeout = null, $options = null) + function connect($addr, $port = 0, $persistent = null, + $timeout = null, $options = null) { if (is_resource($this->fp)) { @fclose($this->fp); @@ -103,11 +121,10 @@ class Net_Socket extends PEAR { if (!$addr) { return $this->raiseError('$addr cannot be empty'); - } elseif (strspn($addr, '.0123456789') == strlen($addr) || - strstr($addr, '/') !== false) { - $this->addr = $addr; + } else if (strspn($addr, ':.0123456789') == strlen($addr)) { + $this->addr = strpos($addr, ':') !== false ? '['.$addr.']' : $addr; } else { - $this->addr = @gethostbyname($addr); + $this->addr = $addr; } $this->port = $port % 65536; @@ -116,40 +133,40 @@ class Net_Socket extends PEAR { $this->persistent = $persistent; } - if ($timeout !== null) { - $this->timeout = $timeout; - } - $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen'; - $errno = 0; - $errstr = ''; + $errno = 0; + $errstr = ''; + $old_track_errors = @ini_set('track_errors', 1); + + if ($timeout <= 0) { + $timeout = @ini_get('default_socket_timeout'); + } + if ($options && function_exists('stream_context_create')) { - if ($this->timeout) { - $timeout = $this->timeout; - } else { - $timeout = 0; - } $context = stream_context_create($options); // Since PHP 5 fsockopen doesn't allow context specification if (function_exists('stream_socket_client')) { - $flags = $this->persistent ? STREAM_CLIENT_PERSISTENT : STREAM_CLIENT_CONNECT; + $flags = STREAM_CLIENT_CONNECT; + + if ($this->persistent) { + $flags = STREAM_CLIENT_PERSISTENT; + } + $addr = $this->addr . ':' . $this->port; - $fp = stream_socket_client($addr, $errno, $errstr, $timeout, $flags, $context); + $fp = stream_socket_client($addr, $errno, $errstr, + $timeout, $flags, $context); } else { - $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout, $context); + $fp = @$openfunc($this->addr, $this->port, $errno, + $errstr, $timeout, $context); } } else { - if ($this->timeout) { - $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $this->timeout); - } else { - $fp = @$openfunc($this->addr, $this->port, $errno, $errstr); - } + $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, $timeout); } if (!$fp) { - if ($errno == 0 && isset($php_errormsg)) { + if ($errno == 0 && !strlen($errstr) && isset($php_errormsg)) { $errstr = $php_errormsg; } @ini_set('track_errors', $old_track_errors); @@ -158,7 +175,7 @@ class Net_Socket extends PEAR { @ini_set('track_errors', $old_track_errors); $this->fp = $fp; - + $this->setTimeout(); return $this->setBlocking($this->blocking); } @@ -179,6 +196,18 @@ class Net_Socket extends PEAR { return true; } + /** + * Set the newline character/sequence to use. + * + * @param string $newline Newline character(s) + * @return boolean True + */ + function setNewline($newline) + { + $this->newline = $newline; + return true; + } + /** * Find out if the socket is in blocking mode. * @@ -196,7 +225,8 @@ class Net_Socket extends PEAR { * if there is no data available, whereas it will block until there * is data for blocking sockets. * - * @param boolean $mode True for blocking sockets, false for nonblocking. + * @param boolean $mode True for blocking sockets, false for nonblocking. + * * @access public * @return mixed true on success or a PEAR_Error instance otherwise */ @@ -207,7 +237,7 @@ class Net_Socket extends PEAR { } $this->blocking = $mode; - socket_set_blocking($this->fp, $this->blocking); + stream_set_blocking($this->fp, (int)$this->blocking); return true; } @@ -215,25 +245,40 @@ class Net_Socket extends PEAR { * Sets the timeout value on socket descriptor, * expressed in the sum of seconds and microseconds * - * @param integer $seconds Seconds. - * @param integer $microseconds Microseconds. + * @param integer $seconds Seconds. + * @param integer $microseconds Microseconds, optional. + * * @access public - * @return mixed true on success or a PEAR_Error instance otherwise + * @return mixed True on success or false on failure or + * a PEAR_Error instance when not connected */ - function setTimeout($seconds, $microseconds) + function setTimeout($seconds = null, $microseconds = null) { if (!is_resource($this->fp)) { return $this->raiseError('not connected'); } - return socket_set_timeout($this->fp, $seconds, $microseconds); + if ($seconds === null && $microseconds === null) { + $seconds = (int) $this->timeout; + $microseconds = (int) (($this->timeout - $seconds) * 1000000); + } else { + $this->timeout = $seconds + $microseconds/1000000; + } + + if ($this->timeout > 0) { + return stream_set_timeout($this->fp, (int) $seconds, (int) $microseconds); + } + else { + return false; + } } /** * Sets the file buffering size on the stream. * See php's stream_set_write_buffer for more information. * - * @param integer $size Write buffer size. + * @param integer $size Write buffer size. + * * @access public * @return mixed on success or an PEAR_Error object otherwise */ @@ -262,7 +307,8 @@ class Net_Socket extends PEAR { *

* * @access public - * @return mixed Array containing information about existing socket resource or a PEAR_Error instance otherwise + * @return mixed Array containing information about existing socket + * resource or a PEAR_Error instance otherwise */ function getStatus() { @@ -270,23 +316,32 @@ class Net_Socket extends PEAR { return $this->raiseError('not connected'); } - return socket_get_status($this->fp); + return stream_get_meta_data($this->fp); } /** * Get a specified line of data * + * @param int $size Reading ends when size - 1 bytes have been read, + * or a newline or an EOF (whichever comes first). + * If no size is specified, it will keep reading from + * the stream until it reaches the end of the line. + * * @access public - * @return $size bytes of data from the socket, or a PEAR_Error if - * not connected. + * @return mixed $size bytes of data from the socket, or a PEAR_Error if + * not connected. If an error occurs, FALSE is returned. */ - function gets($size) + function gets($size = null) { if (!is_resource($this->fp)) { return $this->raiseError('not connected'); } - return @fgets($this->fp, $size); + if (is_null($size)) { + return @fgets($this->fp); + } else { + return @fgets($this->fp, $size); + } } /** @@ -295,7 +350,8 @@ class Net_Socket extends PEAR { * chunk; if you know the size of the data you're getting * beforehand, this is definitely the way to go. * - * @param integer $size The number of bytes to read from the socket. + * @param integer $size The number of bytes to read from the socket. + * * @access public * @return $size bytes of data from the socket, or a PEAR_Error if * not connected. @@ -312,14 +368,16 @@ class Net_Socket extends PEAR { /** * Write a specified amount of data. * - * @param string $data Data to write. - * @param integer $blocksize Amount of data to write at once. - * NULL means all at once. + * @param string $data Data to write. + * @param integer $blocksize Amount of data to write at once. + * NULL means all at once. * * @access public - * @return mixed If the socket is not connected, returns an instance of PEAR_Error - * If the write succeeds, returns the number of bytes written + * @return mixed If the socket is not connected, returns an instance of + * PEAR_Error. + * If the write succeeds, returns the number of bytes written. * If the write fails, returns false. + * If the socket times out, returns an instance of PEAR_Error. */ function write($data, $blocksize = null) { @@ -328,19 +386,47 @@ class Net_Socket extends PEAR { } if (is_null($blocksize) && !OS_WINDOWS) { - return @fwrite($this->fp, $data); + $written = @fwrite($this->fp, $data); + + // Check for timeout or lost connection + if (!$written) { + $meta_data = $this->getStatus(); + + if (!is_array($meta_data)) { + return $meta_data; // PEAR_Error + } + + if (!empty($meta_data['timed_out'])) { + return $this->raiseError('timed out'); + } + } + + return $written; } else { if (is_null($blocksize)) { $blocksize = 1024; } - $pos = 0; + $pos = 0; $size = strlen($data); while ($pos < $size) { $written = @fwrite($this->fp, substr($data, $pos, $blocksize)); - if ($written === false) { - return false; + + // Check for timeout or lost connection + if (!$written) { + $meta_data = $this->getStatus(); + + if (!is_array($meta_data)) { + return $meta_data; // PEAR_Error + } + + if (!empty($meta_data['timed_out'])) { + return $this->raiseError('timed out'); + } + + return $written; } + $pos += $written; } @@ -349,10 +435,12 @@ class Net_Socket extends PEAR { } /** - * Write a line of data to the socket, followed by a trailing "\r\n". + * Write a line of data to the socket, followed by a trailing newline. + * + * @param string $data Data to write * * @access public - * @return mixed fputs result, or an error + * @return mixed fwrite() result, or PEAR_Error when not connected */ function writeLine($data) { @@ -360,7 +448,7 @@ class Net_Socket extends PEAR { return $this->raiseError('not connected'); } - return fwrite($this->fp, $data . "\r\n"); + return fwrite($this->fp, $data . $this->newline); } /** @@ -441,7 +529,7 @@ class Net_Socket extends PEAR { } $string = ''; - while (($char = @fread($this->fp, 1)) != "\x00") { + while (($char = @fread($this->fp, 1)) != "\x00") { $string .= $char; } return $string; @@ -481,11 +569,13 @@ class Net_Socket extends PEAR { } $line = ''; + $timeout = time() + $this->timeout; + while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) { $line .= @fgets($this->fp, $this->lineLength); if (substr($line, -1) == "\n") { - return rtrim($line, "\r\n"); + return rtrim($line, $this->newline); } } return $line; @@ -521,9 +611,9 @@ class Net_Socket extends PEAR { * Runs the equivalent of the select() system call on the socket * with a timeout specified by tv_sec and tv_usec. * - * @param integer $state Which of read/write/error to check for. - * @param integer $tv_sec Number of seconds for timeout. - * @param integer $tv_usec Number of microseconds for timeout. + * @param integer $state Which of read/write/error to check for. + * @param integer $tv_sec Number of seconds for timeout. + * @param integer $tv_usec Number of microseconds for timeout. * * @access public * @return False if select fails, integer describing which of read/write/error @@ -535,8 +625,8 @@ class Net_Socket extends PEAR { return $this->raiseError('not connected'); } - $read = null; - $write = null; + $read = null; + $write = null; $except = null; if ($state & NET_SOCKET_READ) { $read[] = $this->fp; @@ -547,7 +637,8 @@ class Net_Socket extends PEAR { if ($state & NET_SOCKET_ERROR) { $except[] = $this->fp; } - if (false === ($sr = stream_select($read, $write, $except, $tv_sec, $tv_usec))) { + if (false === ($sr = stream_select($read, $write, $except, + $tv_sec, $tv_usec))) { return false; } @@ -567,15 +658,17 @@ class Net_Socket extends PEAR { /** * Turns encryption on/off on a connected socket. * - * @param bool $enabled Set this parameter to true to enable encryption - * and false to disable encryption. - * @param integer $type Type of encryption. See - * http://se.php.net/manual/en/function.stream-socket-enable-crypto.php for values. + * @param bool $enabled Set this parameter to true to enable encryption + * and false to disable encryption. + * @param integer $type Type of encryption. See stream_socket_enable_crypto() + * for values. * + * @see http://se.php.net/manual/en/function.stream-socket-enable-crypto.php * @access public - * @return false on error, true on success and 0 if there isn't enough data and the - * user should try again (non-blocking sockets only). A PEAR_Error object - * is returned if the socket is not connected + * @return false on error, true on success and 0 if there isn't enough data + * and the user should try again (non-blocking sockets only). + * A PEAR_Error object is returned if the socket is not + * connected */ function enableCrypto($enabled, $type) { @@ -585,7 +678,8 @@ class Net_Socket extends PEAR { } return @stream_socket_enable_crypto($this->fp, $enabled, $type); } else { - return $this->raiseError('Net_Socket::enableCrypto() requires php version >= 5.1.0'); + $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0'; + return $this->raiseError($msg); } } diff --git a/WEB-INF/lib/pear/OS/Guess.php b/WEB-INF/lib/pear/OS/Guess.php index d3f2cc76..4c9254a2 100644 --- a/WEB-INF/lib/pear/OS/Guess.php +++ b/WEB-INF/lib/pear/OS/Guess.php @@ -10,7 +10,6 @@ * @author Gregory Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Guess.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since PEAR 0.1 */ @@ -87,7 +86,7 @@ * @author Gregory Beaver * @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 Release 0.1 */ @@ -99,7 +98,7 @@ class OS_Guess var $release; var $extra; - function OS_Guess($uname = null) + function __construct($uname = null) { list($this->sysname, $this->release, @@ -335,4 +334,4 @@ class OS_Guess * indent-tabs-mode: nil * c-basic-offset: 4 * End: - */ \ No newline at end of file + */ diff --git a/WEB-INF/lib/pear/PEAR.php b/WEB-INF/lib/pear/PEAR.php index 2aa85259..d661cc21 100644 --- a/WEB-INF/lib/pear/PEAR.php +++ b/WEB-INF/lib/pear/PEAR.php @@ -14,7 +14,6 @@ * @author Greg Beaver * @copyright 1997-2010 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: PEAR.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -33,8 +32,6 @@ define('PEAR_ERROR_CALLBACK', 16); */ define('PEAR_ERROR_EXCEPTION', 32); /**#@-*/ -define('PEAR_ZE2', (function_exists('version_compare') && - version_compare(zend_version(), "2-dev", "ge"))); if (substr(PHP_OS, 0, 3) == 'WIN') { define('OS_WINDOWS', true); @@ -78,7 +75,7 @@ $GLOBALS['_PEAR_error_handler_stack'] = array(); * @author Greg Beaver * @copyright 1997-2006 The PHP Group * @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 * @see PEAR_Error * @since Class available since PHP 4.0.2 @@ -136,6 +133,18 @@ class PEAR */ var $_expected_errors = array(); + /** + * List of methods that can be called both statically and non-statically. + * @var array + */ + protected static $bivalentMethods = array( + 'setErrorHandling' => true, + 'raiseError' => true, + 'throwError' => true, + 'pushErrorHandling' => true, + 'popErrorHandling' => true, + ); + /** * Constructor. Registers this object in * $_PEAR_destructor_object_list for destructor emulation if a @@ -146,7 +155,7 @@ class PEAR * @access public * @return void */ - function PEAR($error_class = null) + function __construct($error_class = null) { $classname = strtolower(get_class($this)); if ($this->_debug) { @@ -173,6 +182,18 @@ class PEAR } } + /** + * Only here for backwards compatibility. + * E.g. Archive_Tar calls $this->PEAR() in its constructor. + * + * @param string $error_class Which class to use for error objects, + * defaults to PEAR_Error. + */ + public function PEAR($error_class = null) + { + self::__construct($error_class); + } + /** * Destructor (the emulated type of...). Does nothing right now, * but is included for forward compatibility, so subclass @@ -190,19 +211,44 @@ class PEAR } } + public function __call($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array($this), $arguments) + ); + } + + public static function __callStatic($method, $arguments) + { + if (!isset(self::$bivalentMethods[$method])) { + trigger_error( + 'Call to undefined method PEAR::' . $method . '()', E_USER_ERROR + ); + } + return call_user_func_array( + array(get_class(), '_' . $method), + array_merge(array(null), $arguments) + ); + } + /** * If you have a class that's mostly/entirely static, and you need static * properties, you can use this method to simulate them. Eg. in your method(s) * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar'); * You MUST use a reference, or they will not persist! * - * @access public * @param string $class The calling classname, to prevent clashes * @param string $var The variable to retrieve. * @return mixed A reference to the variable. If not set it will be * auto initialised to NULL. */ - function &getStaticProperty($class, $var) + public static function &getStaticProperty($class, $var) { static $properties; if (!isset($properties[$class])) { @@ -220,12 +266,12 @@ class PEAR * Use this function to register a shutdown method for static * classes. * - * @access public * @param mixed $func The function name (or array of class/method) to call * @param mixed $args The arguments to pass to the function + * * @return void */ - function registerShutdownFunc($func, $args = array()) + public static function registerShutdownFunc($func, $args = array()) { // if we are called statically, there is a potential // that no shutdown func is registered. Bug #6445 @@ -244,10 +290,10 @@ class PEAR * only if $code is a string and * $obj->getMessage() == $code or * $code is an integer and $obj->getCode() == $code - * @access public + * * @return bool true if parameter is an error */ - function isError($data, $code = null) + public static function isError($data, $code = null) { if (!is_a($data, 'PEAR_Error')) { return false; @@ -269,6 +315,9 @@ class PEAR * PEAR objects. If called in an object, setErrorHandling sets * the default behaviour for that object. * + * @param object $object + * Object the method was called on (non-static mode) + * * @param int $mode * One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT, * PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE, @@ -300,11 +349,12 @@ class PEAR * * @since PHP 4.0.5 */ - function setErrorHandling($mode = null, $options = null) - { - if (isset($this) && is_a($this, 'PEAR')) { - $setmode = &$this->_default_error_mode; - $setoptions = &$this->_default_error_options; + protected static function _setErrorHandling( + $object, $mode = null, $options = null + ) { + if ($object !== null) { + $setmode = &$object->_default_error_mode; + $setoptions = &$object->_default_error_options; } else { $setmode = &$GLOBALS['_PEAR_default_error_mode']; $setoptions = &$GLOBALS['_PEAR_default_error_options']; @@ -464,12 +514,12 @@ class PEAR * @param bool $skipmsg If true, raiseError will only pass error codes, * the error message parameter will be dropped. * - * @access public * @return object a PEAR error object * @see PEAR::setErrorHandling * @since PHP 4.0.5 */ - function &raiseError($message = null, + protected static function _raiseError($object, + $message = null, $code = null, $mode = null, $options = null, @@ -487,10 +537,10 @@ class PEAR } if ( - isset($this) && - isset($this->_expected_errors) && - count($this->_expected_errors) > 0 && - count($exp = end($this->_expected_errors)) + $object !== null && + isset($object->_expected_errors) && + count($object->_expected_errors) > 0 && + count($exp = end($object->_expected_errors)) ) { if ($exp[0] == "*" || (is_int(reset($exp)) && in_array($code, $exp)) || @@ -503,9 +553,9 @@ class PEAR // No mode given, try global ones if ($mode === null) { // Class error handler - if (isset($this) && isset($this->_default_error_mode)) { - $mode = $this->_default_error_mode; - $options = $this->_default_error_options; + if ($object !== null && isset($object->_default_error_mode)) { + $mode = $object->_default_error_mode; + $options = $object->_default_error_options; // Global error handler } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) { $mode = $GLOBALS['_PEAR_default_error_mode']; @@ -515,18 +565,12 @@ class PEAR if ($error_class !== null) { $ec = $error_class; - } elseif (isset($this) && isset($this->_error_class)) { - $ec = $this->_error_class; + } elseif ($object !== null && isset($object->_error_class)) { + $ec = $object->_error_class; } else { $ec = 'PEAR_Error'; } - if (intval(PHP_VERSION) < 5) { - // little non-eval hack to fix bug #12147 - include 'PEAR/FixPHP5PEARWarnings.php'; - return $a; - } - if ($skipmsg) { $a = new $ec($code, $mode, $options, $userinfo); } else { @@ -548,14 +592,13 @@ class PEAR * @param string $userinfo If you need to pass along for example debug * information, this parameter is meant for that. * - * @access public * @return object a PEAR error object * @see PEAR::raiseError */ - function &throwError($message = null, $code = null, $userinfo = null) + protected static function _throwError($object, $message = null, $code = null, $userinfo = null) { - if (isset($this) && is_a($this, 'PEAR')) { - $a = &$this->raiseError($message, $code, null, null, $userinfo); + if ($object !== null) { + $a = &$object->raiseError($message, $code, null, null, $userinfo); return $a; } @@ -563,7 +606,7 @@ class PEAR return $a; } - function staticPushErrorHandling($mode, $options = null) + public static function staticPushErrorHandling($mode, $options = null) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; $def_mode = &$GLOBALS['_PEAR_default_error_mode']; @@ -598,7 +641,7 @@ class PEAR return true; } - function staticPopErrorHandling() + public static function staticPopErrorHandling() { $stack = &$GLOBALS['_PEAR_error_handler_stack']; $setmode = &$GLOBALS['_PEAR_default_error_mode']; @@ -646,20 +689,20 @@ class PEAR * * @see PEAR::setErrorHandling */ - function pushErrorHandling($mode, $options = null) + protected static function _pushErrorHandling($object, $mode, $options = null) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; - if (isset($this) && is_a($this, 'PEAR')) { - $def_mode = &$this->_default_error_mode; - $def_options = &$this->_default_error_options; + if ($object !== null) { + $def_mode = &$object->_default_error_mode; + $def_options = &$object->_default_error_options; } else { $def_mode = &$GLOBALS['_PEAR_default_error_mode']; $def_options = &$GLOBALS['_PEAR_default_error_options']; } $stack[] = array($def_mode, $def_options); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); + if ($object !== null) { + $object->setErrorHandling($mode, $options); } else { PEAR::setErrorHandling($mode, $options); } @@ -674,14 +717,14 @@ class PEAR * * @see PEAR::pushErrorHandling */ - function popErrorHandling() + protected static function _popErrorHandling($object) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; array_pop($stack); list($mode, $options) = $stack[sizeof($stack) - 1]; array_pop($stack); - if (isset($this) && is_a($this, 'PEAR')) { - $this->setErrorHandling($mode, $options); + if ($object !== null) { + $object->setErrorHandling($mode, $options); } else { PEAR::setErrorHandling($mode, $options); } @@ -689,13 +732,13 @@ class PEAR } /** - * OS independant PHP extension load. Remember to take care + * OS independent PHP extension load. Remember to take care * on the correct extension name for case sensitive OSes. * * @param string $ext The extension name * @return bool Success or not on the dl() call */ - function loadExtension($ext) + public static function loadExtension($ext) { if (extension_loaded($ext)) { return true; @@ -704,8 +747,7 @@ class PEAR // if either returns true dl() will produce a FATAL error, stop that if ( function_exists('dl') === false || - ini_get('enable_dl') != 1 || - ini_get('safe_mode') == 1 + ini_get('enable_dl') != 1 ) { return false; } @@ -726,10 +768,6 @@ class PEAR } } -if (PEAR_ZE2) { - include_once 'PEAR5.php'; -} - function _PEAR_call_destructors() { global $_PEAR_destructor_object_list; @@ -737,11 +775,8 @@ function _PEAR_call_destructors() sizeof($_PEAR_destructor_object_list)) { reset($_PEAR_destructor_object_list); - if (PEAR_ZE2) { - $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo'); - } else { - $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); - } + + $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo'); if ($destructLifoExists) { $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list); @@ -788,7 +823,7 @@ function _PEAR_call_destructors() * @author Gregory Beaver * @copyright 1997-2006 The PHP Group * @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/manual/en/core.pear.pear-error.php * @see PEAR::raiseError(), PEAR::throwError() * @since Class available since PHP 4.0.2 @@ -823,7 +858,7 @@ class PEAR_Error * @access public * */ - function PEAR_Error($message = 'unknown error', $code = null, + function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { if ($mode === null) { @@ -834,11 +869,7 @@ class PEAR_Error $this->mode = $mode; $this->userinfo = $userinfo; - if (PEAR_ZE2) { - $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); - } else { - $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); - } + $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace'); if (!$skiptrace) { $this->backtrace = debug_backtrace(); @@ -896,6 +927,24 @@ class PEAR_Error } } + /** + * Only here for backwards compatibility. + * + * Class "Cache_Error" still uses it, among others. + * + * @param string $message Message + * @param int $code Error code + * @param int $mode Error mode + * @param mixed $options See __construct() + * @param string $userinfo Additional user/debug info + */ + public function PEAR_Error( + $message = 'unknown error', $code = null, $mode = null, + $options = null, $userinfo = null + ) { + self::__construct($message, $code, $mode, $options, $userinfo); + } + /** * Get the error mode from an error object. * diff --git a/WEB-INF/lib/pear/PEAR/Autoloader.php b/WEB-INF/lib/pear/PEAR/Autoloader.php index 0ed707ec..bcb57f65 100644 --- a/WEB-INF/lib/pear/PEAR/Autoloader.php +++ b/WEB-INF/lib/pear/PEAR/Autoloader.php @@ -10,7 +10,6 @@ * @author Stig Bakken * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Autoloader.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/manual/en/core.ppm.php#core.ppm.pear-autoloader * @since File available since Release 0.1 * @deprecated File deprecated in Release 1.4.0a1 @@ -45,7 +44,7 @@ require_once "PEAR.php"; * @author Stig Bakken * @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/manual/en/core.ppm.php#core.ppm.pear-autoloader * @since File available since Release 0.1 * @deprecated File deprecated in Release 1.4.0a1 @@ -144,7 +143,7 @@ class PEAR_Autoloader extends PEAR $include_file = preg_replace('/[^a-z0-9]/i', '_', $classname); include_once $include_file; } - $obj =& new $classname; + $obj = new $classname; $methods = get_class_methods($classname); foreach ($methods as $method) { // don't import priviate methods and constructors diff --git a/WEB-INF/lib/pear/PEAR/Builder.php b/WEB-INF/lib/pear/PEAR/Builder.php index 90f3a145..94b09f08 100644 --- a/WEB-INF/lib/pear/PEAR/Builder.php +++ b/WEB-INF/lib/pear/PEAR/Builder.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @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 * @@ -23,6 +22,7 @@ */ require_once 'PEAR/Common.php'; require_once 'PEAR/PackageFile.php'; +require_once 'System.php'; /** * Class to handle building (compiling) extensions. @@ -33,7 +33,7 @@ require_once 'PEAR/PackageFile.php'; * @author Greg Beaver * @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 @@ -63,9 +63,9 @@ class PEAR_Builder extends PEAR_Common * * @access public */ - function PEAR_Builder(&$ui) + function __construct(&$ui) { - parent::PEAR_Common(); + parent::__construct(); $this->setFrontendObject($ui); } @@ -79,7 +79,7 @@ class PEAR_Builder extends PEAR_Common $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; @@ -242,7 +242,7 @@ class PEAR_Builder extends PEAR_Common */ 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'))) { @@ -279,7 +279,7 @@ class PEAR_Builder extends PEAR_Common $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; @@ -322,6 +322,16 @@ class PEAR_Builder extends PEAR_Common // {{{ 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) { @@ -375,7 +385,7 @@ class PEAR_Builder extends PEAR_Common 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)) { @@ -476,7 +486,7 @@ class PEAR_Builder extends PEAR_Common return ($exitcode == 0); } - function log($level, $msg) + function log($level, $msg, $append_crlf = true) { if ($this->current_callback) { if ($this->debug >= $level) { @@ -484,6 +494,6 @@ class PEAR_Builder extends PEAR_Common } return; } - return PEAR_Common::log($level, $msg); + return parent::log($level, $msg, $append_crlf); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/ChannelFile.php b/WEB-INF/lib/pear/PEAR/ChannelFile.php index f2c02ab4..f993764c 100644 --- a/WEB-INF/lib/pear/PEAR/ChannelFile.php +++ b/WEB-INF/lib/pear/PEAR/ChannelFile.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: ChannelFile.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -146,7 +145,7 @@ $GLOBALS['_PEAR_CHANNELS_MIRROR_TYPES'] = array('server'); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -194,9 +193,9 @@ class PEAR_ChannelFile */ var $_isValid = false; - function PEAR_ChannelFile() + function __construct() { - $this->_stack = &new PEAR_ErrorStack('PEAR_ChannelFile'); + $this->_stack = new PEAR_ErrorStack('PEAR_ChannelFile'); $this->_stack->setErrorMessageTemplate($this->_getErrorMessage()); $this->_isValid = false; } @@ -306,11 +305,12 @@ class PEAR_ChannelFile /** * @param array - * @static + * * @return PEAR_ChannelFile|false false if invalid */ - function &fromArray($data, $compatibility = false, $stackClass = 'PEAR_ErrorStack') - { + public static function &fromArray( + $data, $compatibility = false, $stackClass = 'PEAR_ErrorStack' + ) { $a = new PEAR_ChannelFile($compatibility, $stackClass); $a->_fromArray($data); if (!$a->validate()) { @@ -322,13 +322,14 @@ class PEAR_ChannelFile /** * Unlike {@link fromArray()} this does not do any validation + * * @param array - * @static + * * @return PEAR_ChannelFile */ - function &fromArrayWithErrors($data, $compatibility = false, - $stackClass = 'PEAR_ErrorStack') - { + public static function &fromArrayWithErrors( + $data, $compatibility = false, $stackClass = 'PEAR_ErrorStack' + ) { $a = new PEAR_ChannelFile($compatibility, $stackClass); $a->_fromArray($data); return $a; @@ -1501,7 +1502,7 @@ class PEAR_ChannelFile if (isset($this->_channelInfo['validatepackage'])) { if ($package == $this->_channelInfo['validatepackage']) { // channel validation packages are always validated by PEAR_Validate - $val = &new PEAR_Validate; + $val = new PEAR_Validate; return $val; } @@ -1513,7 +1514,7 @@ class PEAR_ChannelFile $this->_channelInfo['validatepackage']['_content']) . '.php'; $vclass = str_replace('.', '_', $this->_channelInfo['validatepackage']['_content']); - $val = &new $vclass; + $val = new $vclass; } else { $a = false; return $a; @@ -1521,10 +1522,10 @@ class PEAR_ChannelFile } else { $vclass = str_replace('.', '_', $this->_channelInfo['validatepackage']['_content']); - $val = &new $vclass; + $val = new $vclass; } } else { - $val = &new PEAR_Validate; + $val = new PEAR_Validate; } return $val; @@ -1556,4 +1557,4 @@ class PEAR_ChannelFile return time(); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/ChannelFile/Parser.php b/WEB-INF/lib/pear/PEAR/ChannelFile/Parser.php index e630ace2..a27e8fd0 100644 --- a/WEB-INF/lib/pear/PEAR/ChannelFile/Parser.php +++ b/WEB-INF/lib/pear/PEAR/ChannelFile/Parser.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Parser.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -26,7 +25,7 @@ require_once 'PEAR/ChannelFile.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Command.php b/WEB-INF/lib/pear/PEAR/Command.php index db39b8f3..9ec55507 100644 --- a/WEB-INF/lib/pear/PEAR/Command.php +++ b/WEB-INF/lib/pear/PEAR/Command.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Command.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -94,7 +93,7 @@ $GLOBALS['_PEAR_Command_objects'] = array(); * @author Greg Beaver * @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 Release 0.1 */ @@ -109,11 +108,8 @@ class PEAR_Command * @param object $config Instance of PEAR_Config object * * @return object the command object or a PEAR error - * - * @access public - * @static */ - function &factory($command, &$config) + public static function &factory($command, &$config) { if (empty($GLOBALS['_PEAR_Command_commandlist'])) { PEAR_Command::registerCommands(); @@ -134,13 +130,13 @@ class PEAR_Command return $a; } $ui =& PEAR_Command::getFrontendObject(); - $obj = &new $class($ui, $config); + $obj = new $class($ui, $config); return $obj; } // }}} // {{{ & getObject() - function &getObject($command) + public static function &getObject($command) { $class = $GLOBALS['_PEAR_Command_commandlist'][$command]; if (!class_exists($class)) { @@ -151,7 +147,7 @@ class PEAR_Command } $ui =& PEAR_Command::getFrontendObject(); $config = &PEAR_Config::singleton(); - $obj = &new $class($ui, $config); + $obj = new $class($ui, $config); return $obj; } @@ -162,9 +158,8 @@ class PEAR_Command * Get instance of frontend object. * * @return object|PEAR_Error - * @static */ - function &getFrontendObject() + public static function &getFrontendObject() { $a = &PEAR_Frontend::singleton(); return $a; @@ -179,9 +174,8 @@ class PEAR_Command * @param string $uiclass Name of class implementing the frontend * * @return object the frontend object, or a PEAR error - * @static */ - function &setFrontendClass($uiclass) + public static function &setFrontendClass($uiclass) { $a = &PEAR_Frontend::setFrontendClass($uiclass); return $a; @@ -196,9 +190,8 @@ class PEAR_Command * @param string $uitype Name of the frontend type (for example "CLI") * * @return object the frontend object, or a PEAR error - * @static */ - function setFrontendType($uitype) + public static function setFrontendType($uitype) { $uiclass = 'PEAR_Frontend_' . $uitype; return PEAR_Command::setFrontendClass($uiclass); @@ -221,11 +214,8 @@ class PEAR_Command * included. * * @return bool TRUE on success, a PEAR error on failure - * - * @access public - * @static */ - function registerCommands($merge = false, $dir = null) + public static function registerCommands($merge = false, $dir = null) { $parser = new PEAR_XMLParser; if ($dir === null) { @@ -305,11 +295,8 @@ class PEAR_Command * classes implement them. * * @return array command => implementing class - * - * @access public - * @static */ - function getCommands() + public static function getCommands() { if (empty($GLOBALS['_PEAR_Command_commandlist'])) { PEAR_Command::registerCommands(); @@ -324,11 +311,8 @@ class PEAR_Command * Get the list of command shortcuts. * * @return array shortcut => command - * - * @access public - * @static */ - function getShortcuts() + public static function getShortcuts() { if (empty($GLOBALS['_PEAR_Command_shortcuts'])) { PEAR_Command::registerCommands(); @@ -347,11 +331,8 @@ class PEAR_Command * @param array $long_args (reference) long getopt format * * @return void - * - * @access public - * @static */ - function getGetoptArgs($command, &$short_args, &$long_args) + public static function getGetoptArgs($command, &$short_args, &$long_args) { if (empty($GLOBALS['_PEAR_Command_commandlist'])) { PEAR_Command::registerCommands(); @@ -375,11 +356,8 @@ class PEAR_Command * @param string $command Name of the command * * @return string command description - * - * @access public - * @static */ - function getDescription($command) + public static function getDescription($command) { if (!isset($GLOBALS['_PEAR_Command_commanddesc'][$command])) { return null; @@ -394,11 +372,8 @@ class PEAR_Command * Get help for command. * * @param string $command Name of the command to return help for - * - * @access public - * @static */ - function getHelp($command) + public static function getHelp($command) { $cmds = PEAR_Command::getCommands(); if (isset($GLOBALS['_PEAR_Command_shortcuts'][$command])) { diff --git a/WEB-INF/lib/pear/PEAR/Command/Auth.php b/WEB-INF/lib/pear/PEAR/Command/Auth.php index 63cd152b..aa021ec2 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Auth.php +++ b/WEB-INF/lib/pear/PEAR/Command/Auth.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Auth.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 * @deprecated since 1.8.0alpha1 @@ -30,7 +29,7 @@ require_once 'PEAR/Command/Channels.php'; * @author Greg Beaver * @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 Release 0.1 * @deprecated since 1.8.0alpha1 @@ -74,8 +73,8 @@ password from your user configuration.', * * @access public */ - function PEAR_Command_Auth(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Channels($ui, $config); + parent::__construct($ui, $config); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Build.php b/WEB-INF/lib/pear/PEAR/Command/Build.php index 1de73202..7f851932 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Build.php +++ b/WEB-INF/lib/pear/PEAR/Command/Build.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Build.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -31,7 +30,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -53,9 +52,9 @@ Builds one or more extensions contained in a package.' * * @access public */ - function PEAR_Command_Build(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function doBuild($command, $options, $params) @@ -65,7 +64,7 @@ Builds one or more extensions contained in a package.' $params[0] = 'package.xml'; } - $builder = &new PEAR_Builder($this->ui); + $builder = new PEAR_Builder($this->ui); $this->debug = $this->config->get('verbose'); $err = $builder->build($params[0], array(&$this, 'buildCallback')); if (PEAR::isError($err)) { @@ -82,4 +81,4 @@ Builds one or more extensions contained in a package.' $this->ui->outputData(rtrim($data), 'build'); } } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Channels.php b/WEB-INF/lib/pear/PEAR/Command/Channels.php index fcf01b50..690483d1 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Channels.php +++ b/WEB-INF/lib/pear/PEAR/Command/Channels.php @@ -12,7 +12,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Channels.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -32,7 +31,7 @@ define('PEAR_COMMAND_CHANNELS_CHANNEL_EXISTS', -500); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -167,9 +166,9 @@ configuration.', * * @access public */ - function PEAR_Command_Channels(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function _sortChannels($a, $b) @@ -695,7 +694,7 @@ configuration.', 'already aliased to "' . strtolower($params[1]) . '", cannot re-alias'); } - $chan = &$reg->getChannel($params[0]); + $chan = $reg->getChannel($params[0]); if (PEAR::isError($chan)) { return $this->raiseError('Corrupt registry? Error retrieving channel "' . $params[0] . '" information (' . $chan->getMessage() . ')'); @@ -880,4 +879,4 @@ configuration.', $this->config->store(); return true; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Common.php b/WEB-INF/lib/pear/PEAR/Command/Common.php index 279a7166..4be53762 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Common.php +++ b/WEB-INF/lib/pear/PEAR/Command/Common.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -29,7 +28,7 @@ require_once 'PEAR.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -81,9 +80,9 @@ class PEAR_Command_Common extends PEAR * * @access public */ - function PEAR_Command_Common(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR(); + parent::__construct(); $this->config = &$config; $this->ui = &$ui; } @@ -270,4 +269,4 @@ class PEAR_Command_Common extends PEAR return $this->$func($command, $options, $params); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Config.php b/WEB-INF/lib/pear/PEAR/Command/Config.php index a761b277..705a7cbb 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Config.php +++ b/WEB-INF/lib/pear/PEAR/Command/Config.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Config.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -29,7 +28,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -133,9 +132,9 @@ and uninstall). * * @access public */ - function PEAR_Command_Config(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function doConfigShow($command, $options, $params) @@ -338,7 +337,7 @@ and uninstall). } $params[1] = realpath($params[1]); - $config = &new PEAR_Config($params[1], '#no#system#config#', false, false); + $config = new PEAR_Config($params[1], '#no#system#config#', false, false); if ($root{strlen($root) - 1} == '/') { $root = substr($root, 0, strlen($root) - 1); } @@ -355,6 +354,7 @@ and uninstall). $config->set('download_dir', $windows ? "$root\\pear\\download" : "$root/pear/download"); $config->set('temp_dir', $windows ? "$root\\pear\\temp" : "$root/pear/temp"); $config->set('bin_dir', $windows ? "$root\\pear" : "$root/pear"); + $config->set('man_dir', $windows ? "$root\\pear\\man" : "$root/pear/man"); $config->writeConfigFile(); $this->_showConfig($config); $this->ui->outputData('Successfully created default configuration file "' . $params[1] . '"', @@ -411,4 +411,4 @@ and uninstall). return false; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Install.php b/WEB-INF/lib/pear/PEAR/Command/Install.php index c035f6d2..9d572eda 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Install.php +++ b/WEB-INF/lib/pear/PEAR/Command/Install.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Install.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -30,7 +29,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -313,9 +312,9 @@ Run post-installation scripts in package , if any exist. * * @access public */ - function PEAR_Command_Install(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } // }}} @@ -328,7 +327,7 @@ Run post-installation scripts in package , if any exist. if (!class_exists('PEAR_Downloader')) { require_once 'PEAR/Downloader.php'; } - $a = &new PEAR_Downloader($ui, $options, $config); + $a = new PEAR_Downloader($ui, $options, $config); return $a; } @@ -340,7 +339,7 @@ Run post-installation scripts in package , if any exist. if (!class_exists('PEAR_Installer')) { require_once 'PEAR/Installer.php'; } - $a = &new PEAR_Installer($ui); + $a = new PEAR_Installer($ui); return $a; } @@ -468,7 +467,7 @@ Run post-installation scripts in package , if any exist. $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; $zend_extension_line = 'zend_extension' . $debug . $ts; $all = @file($filename); - if (!$all) { + if ($all === false) { return PEAR::raiseError('php.ini "' . $filename .'" could not be read'); } $zend_extensions = $extensions = array(); @@ -556,7 +555,13 @@ Run post-installation scripts in package , if any exist. $packrootphp_dir = $this->installer->_prependPath( $this->config->get('php_dir', null, 'pear.php.net'), $options['packagingroot']); - $instreg = new PEAR_Registry($packrootphp_dir); // other instreg! + $metadata_dir = $this->config->get('metadata_dir', null, 'pear.php.net'); + if ($metadata_dir) { + $metadata_dir = $this->installer->_prependPath( + $metadata_dir, + $options['packagingroot']); + } + $instreg = new PEAR_Registry($packrootphp_dir, false, false, $metadata_dir); // other instreg! if ($this->config->get('verbose') > 2) { $this->ui->outputData('using package root: ' . $options['packagingroot']); @@ -768,17 +773,13 @@ Run post-installation scripts in package , if any exist. if ($param->getPackageType() == 'extsrc' || $param->getPackageType() == 'extbin') { $exttype = 'extension'; + $extpath = $pinfo[1]['basename']; } else { - ob_start(); - phpinfo(INFO_GENERAL); - $info = ob_get_contents(); - ob_end_clean(); - $debug = function_exists('leak') ? '_debug' : ''; - $ts = preg_match('/Thread Safety.+enabled/', $info) ? '_ts' : ''; - $exttype = 'zend_extension' . $debug . $ts; + $exttype = 'zend_extension'; + $extpath = $atts['installed_as']; } $extrainfo[] = 'You should add "' . $exttype . '=' . - $pinfo[1]['basename'] . '" to php.ini'; + $extpath . '" to php.ini'; } else { $extrainfo[] = 'Extension ' . $instpkg->getProvidesExtension() . ' enabled in php.ini'; @@ -1136,7 +1137,7 @@ Run post-installation scripts in package , if any exist. $dest .= DIRECTORY_SEPARATOR . $pkgname; $orig = $pkgname . '-' . $pkgversion; - $tar = &new Archive_Tar($pkgfile->getArchiveFile()); + $tar = new Archive_Tar($pkgfile->getArchiveFile()); if (!$tar->extractModify($dest, $orig)) { return $this->raiseError('unable to unpack ' . $pkgfile->getArchiveFile()); } @@ -1198,7 +1199,7 @@ Run post-installation scripts in package , if any exist. if (!isset($latestReleases[$channel])) { // fill in cache for this channel - $chan = &$reg->getChannel($channel); + $chan = $reg->getChannel($channel); if (PEAR::isError($chan)) { return $this->raiseError($chan); } @@ -1265,4 +1266,4 @@ Run post-installation scripts in package , if any exist. return $ret; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Mirror.php b/WEB-INF/lib/pear/PEAR/Command/Mirror.php index 4d157c6b..bae7ad13 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Mirror.php +++ b/WEB-INF/lib/pear/PEAR/Command/Mirror.php @@ -9,7 +9,6 @@ * @author Alexander Merz * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Mirror.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.2.0 */ @@ -27,7 +26,7 @@ require_once 'PEAR/Command/Common.php'; * @author Alexander Merz * @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 Release 1.2.0 */ @@ -60,9 +59,9 @@ packages within preferred_state ({config preferred_state}) will be downloaded' * @param object PEAR_Frontend a reference to an frontend * @param object PEAR_Config a reference to the configuration data */ - function PEAR_Command_Mirror(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } /** @@ -82,7 +81,7 @@ packages within preferred_state ({config preferred_state}) will be downloaded' * @param string $command the command * @param array $options the command options before the command * @param array $params the stuff after the command name - * @return bool true if succesful + * @return bool true if successful * @throw PEAR_Error */ function doDownloadAll($command, $options, $params) @@ -136,4 +135,4 @@ packages within preferred_state ({config preferred_state}) will be downloaded' return true; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Package.php b/WEB-INF/lib/pear/PEAR/Command/Package.php index 81df7bf6..c62948f1 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Package.php +++ b/WEB-INF/lib/pear/PEAR/Command/Package.php @@ -12,7 +12,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Package.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -283,9 +282,9 @@ used for automated conversion or learning the format. * * @access public */ - function PEAR_Command_Package(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function _displayValidationResults($err, $warn, $strict = false) @@ -310,7 +309,7 @@ used for automated conversion or learning the format. if (!class_exists('PEAR_Packager')) { require_once 'PEAR/Packager.php'; } - $a = &new PEAR_Packager; + $a = new PEAR_Packager; return $a; } @@ -322,7 +321,7 @@ used for automated conversion or learning the format. if (!class_exists('PEAR_PackageFile')) { require_once 'PEAR/PackageFile.php'; } - $a = &new PEAR_PackageFile($config, $debug); + $a = new PEAR_PackageFile($config, $debug); $common = new PEAR_Common; $common->ui = $this->ui; $a->setLogger($common); @@ -372,7 +371,7 @@ used for automated conversion or learning the format. $info = $obj->fromPackageFile($params[0], PEAR_VALIDATE_NORMAL); } else { $archive = $info->getArchiveFile(); - $tar = &new Archive_Tar($archive); + $tar = new Archive_Tar($archive); $tar->extract(dirname($info->getPackageFile())); $info->setPackageFile(dirname($info->getPackageFile()) . DIRECTORY_SEPARATOR . $info->getPackage() . '-' . $info->getVersion() . DIRECTORY_SEPARATOR . @@ -467,7 +466,7 @@ used for automated conversion or learning the format. 'name' => 'modified', 'type' => 'yesno', 'default' => 'no', - 'prompt' => 'You have files in your SVN checkout (' . $path['from'] . ') that have been modified but not commited, do you still want to tag ' . $version . '?', + 'prompt' => 'You have files in your SVN checkout (' . $path['from'] . ') that have been modified but not committed, do you still want to tag ' . $version . '?', )); $answers = $this->ui->confirmDialog($params); @@ -881,7 +880,7 @@ used for automated conversion or learning the format. ); foreach ($deps as $type => $subd) { $req = ($type == 'required') ? 'Yes' : 'No'; - if ($type == 'group') { + if ($type == 'group' && isset($subd['attribs']['name'])) { $group = $subd['attribs']['name']; } else { $group = ''; @@ -1031,7 +1030,7 @@ used for automated conversion or learning the format. if (!class_exists('PEAR_Installer')) { require_once 'PEAR/Installer.php'; } - $a = &new PEAR_Installer($ui); + $a = new PEAR_Installer($ui); return $a; } @@ -1048,7 +1047,7 @@ used for automated conversion or learning the format. } if (class_exists('PEAR_Command_Packaging')) { - $a = &new PEAR_Command_Packaging($ui, $config); + $a = new PEAR_Command_Packaging($ui, $config); } else { $a = null; } @@ -1121,4 +1120,4 @@ used for automated conversion or learning the format. $this->ui->outputData('Wrote new version 2.0 package.xml to "' . $saved . '"'); return true; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Pickle.php b/WEB-INF/lib/pear/PEAR/Command/Pickle.php index 87aa25ea..af6079b6 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Pickle.php +++ b/WEB-INF/lib/pear/PEAR/Command/Pickle.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 2005-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Pickle.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.1 */ @@ -27,7 +26,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @copyright 2005-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 Release 1.4.1 */ @@ -76,9 +75,9 @@ generate both package.xml. * * @access public */ - function PEAR_Command_Pickle(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } /** @@ -92,7 +91,7 @@ generate both package.xml. require_once 'PEAR/Packager.php'; } - $a = &new PEAR_Packager; + $a = new PEAR_Packager; return $a; } @@ -114,7 +113,7 @@ generate both package.xml. require_once 'PEAR/PackageFile.php'; } - $a = &new PEAR_PackageFile($config, $debug); + $a = new PEAR_PackageFile($config, $debug); $common = new PEAR_Common; $common->ui = $this->ui; $a->setLogger($common); @@ -418,4 +417,4 @@ generate both package.xml. $gen = &$pf->getDefaultGenerator(); $gen->toPackageFile('.'); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Registry.php b/WEB-INF/lib/pear/PEAR/Command/Registry.php index 4304db5d..37ee48be 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Registry.php +++ b/WEB-INF/lib/pear/PEAR/Command/Registry.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Registry.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -29,7 +28,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -98,9 +97,9 @@ installed package.' * * @access public */ - function PEAR_Command_Registry(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function _sortinfo($a, $b) @@ -261,7 +260,7 @@ installed package.' require_once 'PEAR/PackageFile.php'; } - $pkg = &new PEAR_PackageFile($this->config, $this->_debug); + $pkg = new PEAR_PackageFile($this->config, $this->_debug); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $info = &$pkg->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL); PEAR::staticPopErrorHandling(); @@ -435,7 +434,7 @@ installed package.' require_once 'PEAR/PackageFile.php'; } - $pkg = &new PEAR_PackageFile($this->config, $this->_debug); + $pkg = new PEAR_PackageFile($this->config, $this->_debug); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $obj = &$pkg->fromAnyFile($params[0], PEAR_VALIDATE_NORMAL); PEAR::staticPopErrorHandling(); @@ -1142,4 +1141,4 @@ installed package.' $data['raw'] = $obj->getArray(); // no validation needed $this->ui->outputData($data, 'package-info'); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Remote.php b/WEB-INF/lib/pear/PEAR/Command/Remote.php index 74478d83..f73db24f 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Remote.php +++ b/WEB-INF/lib/pear/PEAR/Command/Remote.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Remote.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -31,7 +30,7 @@ require_once 'PEAR/REST.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -155,9 +154,9 @@ parameter. * * @access public */ - function PEAR_Command_Remote(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function _checkChannelForStatus($channel, $chan) @@ -579,7 +578,7 @@ parameter. if (!class_exists('PEAR_Downloader')) { require_once 'PEAR/Downloader.php'; } - $a = &new PEAR_Downloader($this->ui, $options, $this->config); + $a = new PEAR_Downloader($this->ui, $options, $this->config); return $a; } @@ -668,13 +667,13 @@ parameter. $preferred_mirror = $this->config->get('preferred_mirror'); if ($chan->supportsREST($preferred_mirror) && ( - //($base2 = $chan->getBaseURL('REST1.4', $preferred_mirror)) || - ($base = $chan->getBaseURL('REST1.0', $preferred_mirror)) + ($base2 = $chan->getBaseURL('REST1.3', $preferred_mirror)) + || ($base = $chan->getBaseURL('REST1.0', $preferred_mirror)) ) ) { if ($base2) { - $rest = &$this->config->getREST('1.4', array()); + $rest = &$this->config->getREST('1.3', array()); $base = $base2; } else { $rest = &$this->config->getREST('1.0', array()); @@ -807,4 +806,4 @@ parameter. $this->ui->outputData(rtrim($output), $command); return $num; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Command/Test.php b/WEB-INF/lib/pear/PEAR/Command/Test.php index a757d9e5..a59b1cf8 100644 --- a/WEB-INF/lib/pear/PEAR/Command/Test.php +++ b/WEB-INF/lib/pear/PEAR/Command/Test.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Test.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -31,7 +30,7 @@ require_once 'PEAR/Command/Common.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -87,6 +86,10 @@ If none is found, all .phpt tests will be tried instead.', 'shortopt' => 'x', 'doc' => 'Generate a code coverage report (requires Xdebug 2.0.0+)', ), + 'showdiff' => array( + 'shortopt' => 'd', + 'doc' => 'Output diff on test failure', + ), ), 'doc' => '[testfile|dir ...] Run regression tests with PHP\'s regression testing script (run-tests.php).', @@ -100,9 +103,9 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).', * * @access public */ - function PEAR_Command_Test(&$ui, &$config) + function __construct(&$ui, &$config) { - parent::PEAR_Command_Common($ui, $config); + parent::__construct($ui, $config); } function doRunTests($command, $options, $params) @@ -332,6 +335,9 @@ Run regression tests with PHP\'s regression testing script (run-tests.php).', } } - return true; + if (count($failed) == 0) { + return true; + } + return $this->raiseError('Some tests failed'); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Common.php b/WEB-INF/lib/pear/PEAR/Common.php index 3a8c7e80..5fe76ad1 100644 --- a/WEB-INF/lib/pear/PEAR/Common.php +++ b/WEB-INF/lib/pear/PEAR/Common.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1.0 * @deprecated File deprecated since Release 1.4.0a1 @@ -118,7 +117,7 @@ $GLOBALS['_PEAR_Common_script_phases'] = array('pre-install', 'post-install', 'p * @author Greg Beaver * @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 Release 1.4.0a1 * @deprecated This class will disappear, and its components will be spread @@ -165,9 +164,9 @@ class PEAR_Common extends PEAR * * @access public */ - function PEAR_Common() + function __construct() { - parent::PEAR(); + parent::__construct(); $this->config = &PEAR_Config::singleton(); $this->debug = $this->config->get('verbose'); } @@ -241,11 +240,8 @@ class PEAR_Common extends PEAR * @param string $msg message to write to the log * * @return void - * - * @access public - * @static */ - function log($level, $msg, $append_crlf = true) + public function log($level, $msg, $append_crlf = true) { if ($this->debug >= $level) { if (!class_exists('PEAR_Frontend')) { @@ -325,9 +321,8 @@ class PEAR_Common extends PEAR * Get the valid roles for a PEAR package maintainer * * @return array - * @static */ - function getUserRoles() + public static function getUserRoles() { return $GLOBALS['_PEAR_Common_maintainer_roles']; } @@ -336,9 +331,8 @@ class PEAR_Common extends PEAR * Get the valid package release states of packages * * @return array - * @static */ - function getReleaseStates() + public static function getReleaseStates() { return $GLOBALS['_PEAR_Common_release_states']; } @@ -347,9 +341,8 @@ class PEAR_Common extends PEAR * Get the implemented dependency types (php, ext, pkg etc.) * * @return array - * @static */ - function getDependencyTypes() + public static function getDependencyTypes() { return $GLOBALS['_PEAR_Common_dependency_types']; } @@ -358,9 +351,8 @@ class PEAR_Common extends PEAR * Get the implemented dependency relations (has, lt, ge etc.) * * @return array - * @static */ - function getDependencyRelations() + public static function getDependencyRelations() { return $GLOBALS['_PEAR_Common_dependency_relations']; } @@ -369,9 +361,8 @@ class PEAR_Common extends PEAR * Get the implemented file roles * * @return array - * @static */ - function getFileRoles() + public static function getFileRoles() { return $GLOBALS['_PEAR_Common_file_roles']; } @@ -380,9 +371,8 @@ class PEAR_Common extends PEAR * Get the implemented file replacement types in * * @return array - * @static */ - function getReplacementTypes() + public static function getReplacementTypes() { return $GLOBALS['_PEAR_Common_replacement_types']; } @@ -391,9 +381,8 @@ class PEAR_Common extends PEAR * Get the implemented file replacement types in * * @return array - * @static */ - function getProvideTypes() + public static function getProvideTypes() { return $GLOBALS['_PEAR_Common_provide_types']; } @@ -402,9 +391,8 @@ class PEAR_Common extends PEAR * Get the implemented file replacement types in * * @return array - * @static */ - function getScriptPhases() + public static function getScriptPhases() { return $GLOBALS['_PEAR_Common_script_phases']; } @@ -440,9 +428,8 @@ class PEAR_Common extends PEAR /** * @param string $path relative or absolute include path * @return boolean - * @static */ - function isIncludeable($path) + public static function isIncludeable($path) { if (file_exists($path) && is_readable($path)) { return true; @@ -489,7 +476,7 @@ class PEAR_Common extends PEAR */ function infoFromTgzFile($file) { - $packagefile = &new PEAR_PackageFile($this->config); + $packagefile = new PEAR_PackageFile($this->config); $pf = &$packagefile->fromTgzFile($file, PEAR_VALIDATE_NORMAL); return $this->_postProcessChecks($pf); } @@ -508,7 +495,7 @@ class PEAR_Common extends PEAR */ function infoFromDescriptionFile($descfile) { - $packagefile = &new PEAR_PackageFile($this->config); + $packagefile = new PEAR_PackageFile($this->config); $pf = &$packagefile->fromPackageFile($descfile, PEAR_VALIDATE_NORMAL); return $this->_postProcessChecks($pf); } @@ -527,7 +514,7 @@ class PEAR_Common extends PEAR */ function infoFromString($data) { - $packagefile = &new PEAR_PackageFile($this->config); + $packagefile = new PEAR_PackageFile($this->config); $pf = &$packagefile->fromXmlString($data, PEAR_VALIDATE_NORMAL, false); return $this->_postProcessChecks($pf); } @@ -571,7 +558,7 @@ class PEAR_Common extends PEAR function infoFromAny($info) { if (is_string($info) && file_exists($info)) { - $packagefile = &new PEAR_PackageFile($this->config); + $packagefile = new PEAR_PackageFile($this->config); $pf = &$packagefile->fromAnyFile($info, PEAR_VALIDATE_NORMAL); if (PEAR::isError($pf)) { $errs = $pf->getUserinfo(); @@ -604,7 +591,7 @@ class PEAR_Common extends PEAR function xmlFromInfo($pkginfo) { $config = &PEAR_Config::singleton(); - $packagefile = &new PEAR_PackageFile($config); + $packagefile = new PEAR_PackageFile($config); $pf = &$packagefile->fromArray($pkginfo); $gen = &$pf->getDefaultGenerator(); return $gen->toXml(PEAR_VALIDATE_PACKAGING); @@ -626,7 +613,7 @@ class PEAR_Common extends PEAR function validatePackageInfo($info, &$errors, &$warnings, $dir_prefix = '') { $config = &PEAR_Config::singleton(); - $packagefile = &new PEAR_PackageFile($config); + $packagefile = new PEAR_PackageFile($config); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); if (strpos($info, 'fromXmlString($info, PEAR_VALIDATE_NORMAL, ''); @@ -814,24 +801,38 @@ class PEAR_Common extends PEAR * @param string $save_dir (optional) directory to save file in * @param mixed $callback (optional) function/method to call for status * updates - * - * @return string Returns the full path of the downloaded file or a PEAR - * error on failure. If the error is caused by - * socket-related errors, the error object will - * have the fsockopen error code available through - * getCode(). + * @param false|string|array $lastmodified header values to check against + * for caching + * use false to return the header + * values from this download + * @param false|array $accept Accept headers to send + * @param false|string $channel Channel to use for retrieving + * authentication + * + * @return mixed Returns the full path of the downloaded file or a PEAR + * error on failure. If the error is caused by + * socket-related errors, the error object will + * have the fsockopen error code available through + * getCode(). If caching is requested, then return the header + * values. + * If $lastmodified was given and the there are no changes, + * boolean false is returned. * * @access public - * @deprecated in favor of PEAR_Downloader::downloadHttp() */ - function downloadHttp($url, &$ui, $save_dir = '.', $callback = null) - { + function downloadHttp( + $url, &$ui, $save_dir = '.', $callback = null, $lastmodified = null, + $accept = false, $channel = false + ) { if (!class_exists('PEAR_Downloader')) { require_once 'PEAR/Downloader.php'; } - return PEAR_Downloader::downloadHttp($url, $ui, $save_dir, $callback); + return PEAR_Downloader::_downloadHttp( + $this, $url, $ui, $save_dir, $callback, $lastmodified, + $accept, $channel + ); } } require_once 'PEAR/Config.php'; -require_once 'PEAR/PackageFile.php'; \ No newline at end of file +require_once 'PEAR/PackageFile.php'; diff --git a/WEB-INF/lib/pear/PEAR/Config.php b/WEB-INF/lib/pear/PEAR/Config.php index 86a7db3f..3856acb1 100644 --- a/WEB-INF/lib/pear/PEAR/Config.php +++ b/WEB-INF/lib/pear/PEAR/Config.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Config.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -87,6 +86,13 @@ if (getenv('PHP_PEAR_INSTALL_DIR')) { } } +// Default for metadata_dir +if (getenv('PHP_PEAR_METADATA_DIR')) { + define('PEAR_CONFIG_DEFAULT_METADATA_DIR', getenv('PHP_PEAR_METADATA_DIR')); +} else { + define('PEAR_CONFIG_DEFAULT_METADATA_DIR', ''); +} + // Default for ext_dir if (getenv('PHP_PEAR_EXTENSION_DIR')) { define('PEAR_CONFIG_DEFAULT_EXT_DIR', getenv('PHP_PEAR_EXTENSION_DIR')); @@ -142,6 +148,18 @@ if (getenv('PHP_PEAR_WWW_DIR')) { $PEAR_INSTALL_DIR.DIRECTORY_SEPARATOR.'www'); } +// Default for man_dir +if (getenv('PHP_PEAR_MAN_DIR')) { + define('PEAR_CONFIG_DEFAULT_MAN_DIR', getenv('PHP_PEAR_MAN_DIR')); +} else { + if (defined('PHP_MANDIR')) { // Added in PHP5.3.7 + define('PEAR_CONFIG_DEFAULT_MAN_DIR', PHP_MANDIR); + } else { + define('PEAR_CONFIG_DEFAULT_MAN_DIR', PHP_PREFIX . DIRECTORY_SEPARATOR . + 'local' . DIRECTORY_SEPARATOR .'man'); + } +} + // Default for test_dir if (getenv('PHP_PEAR_TEST_DIR')) { define('PEAR_CONFIG_DEFAULT_TEST_DIR', getenv('PHP_PEAR_TEST_DIR')); @@ -246,7 +264,7 @@ if (getenv('PHP_PEAR_SIG_KEYDIR')) { * @author Greg Beaver * @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 Release 0.1 */ @@ -440,6 +458,13 @@ class PEAR_Config extends PEAR 'prompt' => 'PEAR www files directory', 'group' => 'File Locations (Advanced)', ), + 'man_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_MAN_DIR, + 'doc' => 'directory where unix manual pages are installed', + 'prompt' => 'Systems manpage files directory', + 'group' => 'File Locations (Advanced)', + ), 'test_dir' => array( 'type' => 'directory', 'default' => PEAR_CONFIG_DEFAULT_TEST_DIR, @@ -496,6 +521,13 @@ class PEAR_Config extends PEAR 'prompt' => 'php.ini location', 'group' => 'File Locations (Advanced)', ), + 'metadata_dir' => array( + 'type' => 'directory', + 'default' => PEAR_CONFIG_DEFAULT_METADATA_DIR, + 'doc' => 'directory where metadata files are installed (registry, filemap, channels, ...)', + 'prompt' => 'PEAR metadata directory', + 'group' => 'File Locations (Advanced)', + ), // Maintainers 'username' => array( 'type' => 'string', @@ -592,10 +624,10 @@ class PEAR_Config extends PEAR * * @see PEAR_Config::singleton */ - function PEAR_Config($user_file = '', $system_file = '', $ftp_file = false, + function __construct($user_file = '', $system_file = '', $ftp_file = false, $strict = true) { - $this->PEAR(); + parent::__construct(); PEAR_Installer_Role::initializeConfig($this); $sl = DIRECTORY_SEPARATOR; if (empty($user_file)) { @@ -647,7 +679,9 @@ class PEAR_Config extends PEAR $this->configuration['default'][$key] = $info['default']; } - $this->_registry['default'] = &new PEAR_Registry($this->configuration['default']['php_dir']); + $this->_registry['default'] = new PEAR_Registry( + $this->configuration['default']['php_dir'], false, false, + $this->configuration['default']['metadata_dir']); $this->_registry['default']->setConfig($this, false); $this->_regInitialized['default'] = false; //$GLOBALS['_PEAR_Config_instance'] = &$this; @@ -655,9 +689,8 @@ class PEAR_Config extends PEAR /** * Return the default locations of user and system configuration files - * @static */ - function getDefaultConfigFiles() + public static function getDefaultConfigFiles() { $sl = DIRECTORY_SEPARATOR; if (OS_WINDOWS) { @@ -684,17 +717,15 @@ class PEAR_Config extends PEAR * * @return object an existing or new PEAR_Config instance * - * @access public - * * @see PEAR_Config::PEAR_Config */ - function &singleton($user_file = '', $system_file = '', $strict = true) + public static function &singleton($user_file = '', $system_file = '', $strict = true) { if (is_object($GLOBALS['_PEAR_Config_instance'])) { return $GLOBALS['_PEAR_Config_instance']; } - $t_conf = &new PEAR_Config($user_file, $system_file, false, $strict); + $t_conf = new PEAR_Config($user_file, $system_file, false, $strict); if ($t_conf->_errorsFound > 0) { return $t_conf->lastError; } @@ -754,7 +785,9 @@ class PEAR_Config extends PEAR $this->configuration[$layer] = $data; $this->_setupChannels(); if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { - $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer] = new PEAR_Registry( + $phpdir, false, false, + $this->get('metadata_dir', $layer, 'pear.php.net')); $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { @@ -783,7 +816,7 @@ class PEAR_Config extends PEAR return PEAR::raiseError('PEAR_RemoteInstaller must be installed to use remote config'); } - $this->_ftp = &new PEAR_FTP; + $this->_ftp = new PEAR_FTP; $this->_ftp->pushErrorHandling(PEAR_ERROR_RETURN); $e = $this->_ftp->init($path); if (PEAR::isError($e)) { @@ -911,7 +944,9 @@ class PEAR_Config extends PEAR $this->_setupChannels(); if (!$this->_noRegistry && ($phpdir = $this->get('php_dir', $layer, 'pear.php.net'))) { - $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer] = new PEAR_Registry( + $phpdir, false, false, + $this->get('metadata_dir', $layer, 'pear.php.net')); $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { @@ -924,9 +959,8 @@ class PEAR_Config extends PEAR * @param array * @param array * @return array - * @static */ - function arrayMergeRecursive($arr2, $arr1) + public static function arrayMergeRecursive($arr2, $arr1) { $ret = array(); foreach ($arr2 as $key => $data) { @@ -1022,16 +1056,12 @@ class PEAR_Config extends PEAR } $size = filesize($file); - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); fclose($fp); $contents = file_get_contents($file); if (empty($contents)) { return $this->raiseError('Configuration file "' . $file . '" is empty'); } - set_magic_quotes_runtime($rt); - $version = false; if (preg_match('/^#PEAR_Config\s+(\S+)\s+/si', $contents, $matches)) { $version = $matches[1]; @@ -1357,7 +1387,7 @@ class PEAR_Config extends PEAR if ($key == 'preferred_mirror') { $reg = &$this->getRegistry(); if (is_object($reg)) { - $chan = &$reg->getChannel($channel); + $chan = $reg->getChannel($channel); if (PEAR::isError($chan)) { return $channel; } @@ -1383,7 +1413,7 @@ class PEAR_Config extends PEAR if ($key == 'preferred_mirror') { $reg = &$this->getRegistry(); if (is_object($reg)) { - $chan = &$reg->getChannel($channel); + $chan = $reg->getChannel($channel); if (PEAR::isError($chan)) { return $channel; } @@ -1434,7 +1464,7 @@ class PEAR_Config extends PEAR if ($ret !== null) { $reg = &$this->getRegistry($layer); if (is_object($reg)) { - $chan = &$reg->getChannel($channel); + $chan = $reg->getChannel($channel); if (PEAR::isError($chan)) { return $channel; } @@ -1492,7 +1522,7 @@ class PEAR_Config extends PEAR $reg = &$this->getRegistry($layer); if (is_object($reg)) { - $chan = &$reg->getChannel($channel ? $channel : 'pear.php.net'); + $chan = $reg->getChannel($channel ? $channel : 'pear.php.net'); if (PEAR::isError($chan)) { return false; } @@ -1574,7 +1604,7 @@ class PEAR_Config extends PEAR if ($key == 'php_dir' && !$this->_noRegistry) { if (!isset($this->_registry[$layer]) || $value != $this->_registry[$layer]->install_dir) { - $this->_registry[$layer] = &new PEAR_Registry($value); + $this->_registry[$layer] = new PEAR_Registry($value); $this->_regInitialized[$layer] = false; $this->_registry[$layer]->setConfig($this, false); } @@ -1604,7 +1634,9 @@ class PEAR_Config extends PEAR if (!is_object($this->_registry[$layer])) { if ($phpdir = $this->get('php_dir', $layer, 'pear.php.net')) { - $this->_registry[$layer] = &new PEAR_Registry($phpdir); + $this->_registry[$layer] = new PEAR_Registry( + $phpdir, false, false, + $this->get('metadata_dir', $layer, 'pear.php.net')); $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } else { @@ -2035,7 +2067,7 @@ class PEAR_Config extends PEAR require_once 'PEAR/REST/' . $version . '.php'; } - $remote = &new $class($this, $options); + $remote = new $class($this, $options); return $remote; } @@ -2088,7 +2120,9 @@ class PEAR_Config extends PEAR continue; } $this->_registry[$layer] = - &new PEAR_Registry($this->get('php_dir', $layer, 'pear.php.net')); + new PEAR_Registry( + $this->get('php_dir', $layer, 'pear.php.net'), false, false, + $this->get('metadata_dir', $layer, 'pear.php.net')); $this->_registry[$layer]->setConfig($this, false); $this->_regInitialized[$layer] = false; } diff --git a/WEB-INF/lib/pear/PEAR/Dependency2.php b/WEB-INF/lib/pear/PEAR/Dependency2.php index f3ddeb1c..635c551e 100644 --- a/WEB-INF/lib/pear/PEAR/Dependency2.php +++ b/WEB-INF/lib/pear/PEAR/Dependency2.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Dependency2.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -31,7 +30,7 @@ require_once 'PEAR/Validate.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -82,7 +81,7 @@ class PEAR_Dependency2 * @param array format of PEAR_Registry::parsedPackageName() * @param int installation state (one of PEAR_VALIDATE_*) */ - function PEAR_Dependency2(&$config, $installoptions, $package, + function __construct(&$config, $installoptions, $package, $state = PEAR_VALIDATE_INSTALLING) { $this->_config = &$config; @@ -541,7 +540,7 @@ class PEAR_Dependency2 */ function getPEARVersion() { - return '1.9.4'; + return '1.10.1'; } function validatePearinstallerDependency($dep) @@ -607,7 +606,7 @@ class PEAR_Dependency2 * @param boolean whether this is a required dependency * @param array a list of downloaded packages to be installed, if any * @param boolean if true, then deps on pear.php.net that fail will also check - * against pecl.php.net packages to accomodate extensions that have + * against pecl.php.net packages to accommodate extensions that have * moved to pecl.php.net from pear.php.net */ function validatePackageDependency($dep, $required, $params, $depv1 = false) @@ -894,9 +893,9 @@ class PEAR_Dependency2 if (!class_exists('PEAR_Downloader_Package')) { require_once 'PEAR/Downloader/Package.php'; } - $dp = &new PEAR_Downloader_Package($dl); + $dp = new PEAR_Downloader_Package($dl); $dp->setPackageFile($downloaded[$i]); - $params[$i] = &$dp; + $params[$i] = $dp; } // check cache @@ -1175,7 +1174,7 @@ class PEAR_Dependency2 require_once 'PEAR/Downloader/Package.php'; } - $dp = &new PEAR_Downloader_Package($dl); + $dp = new PEAR_Downloader_Package($dl); if (is_object($pkg)) { $dp->setPackageFile($pkg); } else { @@ -1199,7 +1198,7 @@ class PEAR_Dependency2 } foreach ($ds as $d) { - $checker = &new PEAR_Dependency2($this->_config, $this->_options, + $checker = new PEAR_Dependency2($this->_config, $this->_options, array('channel' => $channel, 'package' => $package), $this->_state); $dep = $d['dep']; $required = $d['type'] == 'required'; @@ -1355,4 +1354,4 @@ class PEAR_Dependency2 return array(sprintf($msg, $this->_registry->parsedPackageNameToString( $this->_currentPackage, true))); } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/DependencyDB.php b/WEB-INF/lib/pear/PEAR/DependencyDB.php index 948f0c9d..1ee60434 100644 --- a/WEB-INF/lib/pear/PEAR/DependencyDB.php +++ b/WEB-INF/lib/pear/PEAR/DependencyDB.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: DependencyDB.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -30,7 +29,7 @@ $GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'] = array(); * @author Tomas V.V.Cox * @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 Release 1.4.0a1 */ @@ -89,9 +88,8 @@ class PEAR_DependencyDB * @param PEAR_Config * @param string|false full path to the dependency database, or false to use default * @return PEAR_DependencyDB|PEAR_Error - * @static */ - function &singleton(&$config, $depdb = false) + public static function &singleton(&$config, $depdb = false) { $phpdir = $config->get('php_dir', null, 'pear.php.net'); if (!isset($GLOBALS['_PEAR_DEPENDENCYDB_INSTANCE'][$phpdir])) { @@ -122,8 +120,11 @@ class PEAR_DependencyDB $this->_registry = &$this->_config->getRegistry(); if (!$depdb) { - $this->_depdb = $this->_config->get('php_dir', null, 'pear.php.net') . - DIRECTORY_SEPARATOR . '.depdb'; + $dir = $this->_config->get('metadata_dir', null, 'pear.php.net'); + if (!$dir) { + $dir = $this->_config->get('php_dir', null, 'pear.php.net'); + } + $this->_depdb = $dir . DIRECTORY_SEPARATOR . '.depdb'; } else { $this->_depdb = $depdb; } @@ -550,12 +551,9 @@ class PEAR_DependencyDB return $err; } - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); clearstatcache(); fclose($fp); $data = unserialize(file_get_contents($this->_depdb)); - set_magic_quotes_runtime($rt); $this->_cache = $data; return $data; } @@ -577,10 +575,7 @@ class PEAR_DependencyDB return PEAR::raiseError("Could not open dependencies file `".$this->_depdb."' for writing"); } - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); fwrite($fp, serialize($deps)); - set_magic_quotes_runtime($rt); fclose($fp); $this->_unlock(); $this->_cache = $deps; @@ -766,4 +761,4 @@ class PEAR_DependencyDB ); } } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Downloader.php b/WEB-INF/lib/pear/PEAR/Downloader.php index 730df0b7..6d6cdd7a 100644 --- a/WEB-INF/lib/pear/PEAR/Downloader.php +++ b/WEB-INF/lib/pear/PEAR/Downloader.php @@ -12,7 +12,6 @@ * @author Martin Jansen * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Downloader.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.0 */ @@ -39,7 +38,7 @@ define('PEAR_INSTALLER_ERROR_NO_PREF_STATE', 2); * @author Martin Jansen * @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 Release 1.3.0 */ @@ -140,27 +139,44 @@ class PEAR_Downloader extends PEAR_Common */ var $_downloadDir; + /** + * List of methods that can be called both statically and non-statically. + * @var array + */ + protected static $bivalentMethods = array( + 'setErrorHandling' => true, + 'raiseError' => true, + 'throwError' => true, + 'pushErrorHandling' => true, + 'popErrorHandling' => true, + 'downloadHttp' => true, + ); + /** * @param PEAR_Frontend_* * @param array * @param PEAR_Config */ - function PEAR_Downloader(&$ui, $options, &$config) + function __construct($ui = null, $options = array(), $config = null) { - parent::PEAR_Common(); + parent::__construct(); $this->_options = $options; - $this->config = &$config; - $this->_preferredState = $this->config->get('preferred_state'); + if ($config !== null) { + $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; } - if (isset($this->_options['installroot'])) { - $this->config->setInstallRoot($this->_options['installroot']); + if ($config !== null) { + if (isset($this->_options['installroot'])) { + $this->config->setInstallRoot($this->_options['installroot']); + } + $this->_registry = &$config->getRegistry(); } - $this->_registry = &$config->getRegistry(); if (isset($this->_options['alldeps']) || isset($this->_options['onlyreqdeps'])) { $this->_installed = $this->_registry->listAllPackages(); @@ -235,12 +251,12 @@ class PEAR_Downloader extends PEAR_Common * @param PEAR_Downloader * @return PEAR_Downloader_Package */ - function &newDownloaderPackage(&$t) + function newDownloaderPackage(&$t) { if (!class_exists('PEAR_Downloader_Package')) { require_once 'PEAR/Downloader/Package.php'; } - $a = &new PEAR_Downloader_Package($t); + $a = new PEAR_Downloader_Package($t); return $a; } @@ -256,7 +272,7 @@ class PEAR_Downloader extends PEAR_Common if (!class_exists('PEAR_Dependency2')) { require_once 'PEAR/Dependency2.php'; } - $z = &new PEAR_Dependency2($c, $i, $p, $s); + $z = new PEAR_Dependency2($c, $i, $p, $s); return $z; } @@ -274,7 +290,7 @@ class PEAR_Downloader extends PEAR_Common $channelschecked = array(); // convert all parameters into PEAR_Downloader_Package objects foreach ($params as $i => $param) { - $params[$i] = &$this->newDownloaderPackage($this); + $params[$i] = $this->newDownloaderPackage($this); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $err = $params[$i]->initialize($param); PEAR::staticPopErrorHandling(); @@ -315,7 +331,7 @@ class PEAR_Downloader extends PEAR_Common require_once 'System.php'; } - $curchannel = &$this->_registry->getChannel($params[$i]->getChannel()); + $curchannel = $this->_registry->getChannel($params[$i]->getChannel()); if (PEAR::isError($curchannel)) { PEAR::staticPopErrorHandling(); return $this->raiseError($curchannel); @@ -331,7 +347,10 @@ class PEAR_Downloader extends PEAR_Common $a = $this->downloadHttp($url, $this->ui, $dir, null, $curchannel->lastModified()); PEAR::staticPopErrorHandling(); - if (PEAR::isError($a) || !$a) { + if ($a === false) { + //channel.xml not modified + break; + } else if (PEAR::isError($a)) { // Attempt fallback to https automatically PEAR::pushErrorHandling(PEAR_ERROR_RETURN); $a = $this->downloadHttp('https://' . $mirror . @@ -806,7 +825,7 @@ class PEAR_Downloader extends PEAR_Common } while (false); } - $chan = &$this->_registry->getChannel($parr['channel']); + $chan = $this->_registry->getChannel($parr['channel']); if (PEAR::isError($chan)) { return $chan; } @@ -929,7 +948,7 @@ class PEAR_Downloader extends PEAR_Common $curchannel = $this->config->get('default_channel'); if (isset($dep['uri'])) { $xsdversion = '2.0'; - $chan = &$this->_registry->getChannel('__uri'); + $chan = $this->_registry->getChannel('__uri'); if (PEAR::isError($chan)) { return $chan; } @@ -954,7 +973,7 @@ class PEAR_Downloader extends PEAR_Common } while (false); } - $chan = &$this->_registry->getChannel($remotechannel); + $chan = $this->_registry->getChannel($remotechannel); if (PEAR::isError($chan)) { return $chan; } @@ -969,7 +988,7 @@ class PEAR_Downloader extends PEAR_Common } if (isset($dep['uri'])) { - $info = &$this->newDownloaderPackage($this); + $info = $this->newDownloaderPackage($this); PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); $err = $info->initialize($dep); PEAR::staticPopErrorHandling(); @@ -1523,18 +1542,21 @@ class PEAR_Downloader extends PEAR_Common * use false to return the header values from this download * @param false|array $accept Accept headers to send * @param false|string $channel Channel to use for retrieving authentication - * @return string|array Returns the full path of the downloaded file or a PEAR - * error on failure. If the error is caused by - * socket-related errors, the error object will - * have the fsockopen error code available through - * getCode(). If caching is requested, then return the header - * values. + * @return mixed Returns the full path of the downloaded file or a PEAR + * error on failure. If the error is caused by + * socket-related errors, the error object will + * have the fsockopen error code available through + * getCode(). If caching is requested, then return the header + * values. + * If $lastmodified was given and the there are no changes, + * boolean false is returned. * * @access public */ - function downloadHttp($url, &$ui, $save_dir = '.', $callback = null, $lastmodified = null, - $accept = false, $channel = false) - { + public static function _downloadHttp( + $object, $url, &$ui, $save_dir = '.', $callback = null, $lastmodified = null, + $accept = false, $channel = false + ) { static $redirect = 0; // always reset , so we are clean case of error $wasredirect = $redirect; @@ -1556,8 +1578,8 @@ class PEAR_Downloader extends PEAR_Common $port = isset($info['port']) ? $info['port'] : null; $path = isset($info['path']) ? $info['path'] : null; - if (isset($this)) { - $config = &$this->config; + if ($object !== null) { + $config = $object->config; } else { $config = &PEAR_Config::singleton(); } @@ -1639,9 +1661,9 @@ class PEAR_Downloader extends PEAR_Common } $request .= $ifmodifiedsince . - "User-Agent: PEAR/1.9.4/PHP/" . PHP_VERSION . "\r\n"; + "User-Agent: PEAR/1.10.1/PHP/" . PHP_VERSION . "\r\n"; - if (isset($this)) { // only pass in authentication for non-static calls + if ($object !== null) { // only pass in authentication for non-static calls $username = $config->get('username', null, $channel); $password = $config->get('password', null, $channel); if ($username && $password) { @@ -1689,7 +1711,7 @@ class PEAR_Downloader extends PEAR_Common } $redirect = $wasredirect + 1; - return $this->downloadHttp($headers['location'], + return static::_downloadHttp($object, $headers['location'], $ui, $save_dir, $callback, $lastmodified, $accept); } @@ -1763,4 +1785,4 @@ class PEAR_Downloader extends PEAR_Common } return $dest_file; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Downloader/Package.php b/WEB-INF/lib/pear/PEAR/Downloader/Package.php index 987c9656..fe979eb6 100644 --- a/WEB-INF/lib/pear/PEAR/Downloader/Package.php +++ b/WEB-INF/lib/pear/PEAR/Downloader/Package.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Package.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -50,7 +49,7 @@ define('PEAR_DOWNLOADER_PACKAGE_PHPVERSION', -1004); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -130,7 +129,7 @@ class PEAR_Downloader_Package /** * @param PEAR_Downloader */ - function PEAR_Downloader_Package(&$downloader) + function __construct(&$downloader) { $this->_downloader = &$downloader; $this->_config = &$this->_downloader->config; @@ -397,9 +396,8 @@ class PEAR_Downloader_Package /** * Remove packages to be downloaded that are already installed * @param array of PEAR_Downloader_Package objects - * @static */ - function removeInstalled(&$params) + public static function removeInstalled(&$params) { if (!isset($params[0])) { return; @@ -415,7 +413,7 @@ class PEAR_Downloader_Package if ($param->_installRegistry->packageExists($package, $channel)) { $packageVersion = $param->_installRegistry->packageInfo($package, 'version', $channel); if (version_compare($packageVersion, $param->getVersion(), '==')) { - if (!isset($options['force'])) { + if (!isset($options['force']) && !isset($options['packagingroot'])) { $info = $param->getParsedPackage(); unset($info['version']); unset($info['state']); @@ -427,7 +425,7 @@ class PEAR_Downloader_Package $params[$i] = false; } } elseif (!isset($options['force']) && !isset($options['upgrade']) && - !isset($options['soft'])) { + !isset($options['soft']) && !isset($options['packagingroot'])) { $info = $param->getParsedPackage(); $param->_downloader->log(1, 'Skipping package "' . $param->getShortName() . @@ -1243,7 +1241,7 @@ class PEAR_Downloader_Package * @param array $errorparams empty array * @return array array of stupid duplicated packages in PEAR_Downloader_Package obejcts */ - function detectStupidDuplicates($params, &$errorparams) + public static function detectStupidDuplicates($params, &$errorparams) { $existing = array(); foreach ($params as $i => $param) { @@ -1281,9 +1279,8 @@ class PEAR_Downloader_Package /** * @param array * @param bool ignore install groups - for final removal of dupe packages - * @static */ - function removeDuplicates(&$params, $ignoreGroups = false) + public static function removeDuplicates(&$params, $ignoreGroups = false) { $pnames = array(); foreach ($params as $i => $param) { @@ -1345,9 +1342,8 @@ class PEAR_Downloader_Package } /** - * @static */ - function mergeDependencies(&$params) + public static function mergeDependencies(&$params) { $bundles = $newparams = array(); foreach ($params as $i => $param) { @@ -1384,14 +1380,14 @@ class PEAR_Downloader_Package $obj->setExplicitState($s); } - $obj = &new PEAR_Downloader_Package($params[$i]->getDownloader()); + $obj = new PEAR_Downloader_Package($params[$i]->getDownloader()); PEAR::pushErrorHandling(PEAR_ERROR_RETURN); if (PEAR::isError($dir = $dl->getDownloadDir())) { PEAR::popErrorHandling(); return $dir; } - - $e = $obj->_fromFile($a = $dir . DIRECTORY_SEPARATOR . $file); + $a = $dir . DIRECTORY_SEPARATOR . $file; + $e = $obj->_fromFile($a); PEAR::popErrorHandling(); if (PEAR::isError($e)) { if (!isset($options['soft'])) { @@ -1400,10 +1396,9 @@ class PEAR_Downloader_Package continue; } - $j = &$obj; - if (!PEAR_Downloader_Package::willDownload($j, - array_merge($params, $newparams)) && !$param->isInstalled($j)) { - $newparams[] = &$j; + if (!PEAR_Downloader_Package::willDownload($obj, + array_merge($params, $newparams)) && !$param->isInstalled($obj)) { + $newparams[] = $obj; } } } @@ -1437,7 +1432,7 @@ class PEAR_Downloader_Package // convert the dependencies into PEAR_Downloader_Package objects for the next time around $params[$i]->_downloadDeps = array(); foreach ($newdeps as $dep) { - $obj = &new PEAR_Downloader_Package($params[$i]->getDownloader()); + $obj = new PEAR_Downloader_Package($params[$i]->getDownloader()); if ($s = $params[$i]->explicitState()) { $obj->setExplicitState($s); } @@ -1459,8 +1454,7 @@ class PEAR_Downloader_Package } } - $j = &$obj; - $newparams[] = &$j; + $newparams[] = $obj; } } @@ -1476,9 +1470,8 @@ class PEAR_Downloader_Package /** - * @static */ - function willDownload($param, $params) + public static function willDownload($param, $params) { if (!is_array($params)) { return false; @@ -1501,7 +1494,7 @@ class PEAR_Downloader_Package */ function &getPackagefileObject(&$c, $d) { - $a = &new PEAR_PackageFile($c, $d); + $a = new PEAR_PackageFile($c, $d); return $a; } @@ -1576,7 +1569,7 @@ class PEAR_Downloader_Package if ($this->_rawpackagefile) { require_once 'Archive/Tar.php'; - $tar = &new Archive_Tar($file); + $tar = new Archive_Tar($file); $packagexml = $tar->extractInString('package2.xml'); if (!$packagexml) { $packagexml = $tar->extractInString('package.xml'); @@ -1985,4 +1978,4 @@ class PEAR_Downloader_Package return $info; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/ErrorStack.php b/WEB-INF/lib/pear/PEAR/ErrorStack.php index 0303f527..7b705bdb 100644 --- a/WEB-INF/lib/pear/PEAR/ErrorStack.php +++ b/WEB-INF/lib/pear/PEAR/ErrorStack.php @@ -23,7 +23,6 @@ * @author Greg Beaver * @copyright 2004-2008 Greg Beaver * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR_ErrorStack */ @@ -132,12 +131,11 @@ define('PEAR_ERRORSTACK_ERR_OBJTOSTRING', 2); * $local_stack = new PEAR_ErrorStack('MyPackage'); * * @author Greg Beaver - * @version 1.9.4 + * @version 1.10.1 * @package PEAR_ErrorStack * @category Debugging * @copyright 2004-2008 Greg Beaver * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: ErrorStack.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR_ErrorStack */ class PEAR_ErrorStack { @@ -194,43 +192,43 @@ class PEAR_ErrorStack { * @access protected */ var $_contextCallback = false; - + /** * If set to a valid callback, this will be called every time an error * is pushed onto the stack. The return value will be used to determine * whether to allow an error to be pushed or logged. - * + * * The return value must be one an PEAR_ERRORSTACK_* constant * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @var false|string|array * @access protected */ var $_errorCallback = array(); - + /** * PEAR::Log object for logging errors * @var false|Log * @access protected */ var $_logger = false; - + /** * Error messages - designed to be overridden * @var array * @abstract */ var $_errorMsgs = array(); - + /** * Set up a new error stack - * + * * @param string $package name of the package this error stack represents * @param callback $msgCallback callback used for error message generation * @param callback $contextCallback callback used for context generation, * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error */ - function PEAR_ErrorStack($package, $msgCallback = false, $contextCallback = false, + function __construct($package, $msgCallback = false, $contextCallback = false, $throwPEAR_Error = false) { $this->_package = $package; @@ -250,12 +248,13 @@ class PEAR_ErrorStack { * defaults to {@link getFileLine()} * @param boolean $throwPEAR_Error * @param string $stackClass class to instantiate - * @static + * * @return PEAR_ErrorStack */ - function &singleton($package, $msgCallback = false, $contextCallback = false, - $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack') - { + public static function &singleton( + $package, $msgCallback = false, $contextCallback = false, + $throwPEAR_Error = false, $stackClass = 'PEAR_ErrorStack' + ) { if (isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { return $GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package]; } @@ -297,15 +296,14 @@ class PEAR_ErrorStack { /** * Set up a PEAR::Log object for all error stacks that don't have one * @param Log $log - * @static */ - function setDefaultLogger(&$log) + public static function setDefaultLogger(&$log) { if (is_object($log) && method_exists($log, 'log') ) { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; } elseif (is_callable($log)) { $GLOBALS['_PEAR_ERRORSTACK_DEFAULT_LOGGER'] = &$log; - } + } } /** @@ -358,9 +356,8 @@ class PEAR_ErrorStack { * messages for a singleton * @param array|string Callback function/method * @param string Package name, or false for all packages - * @static */ - function setDefaultCallback($callback = false, $package = false) + public static function setDefaultCallback($callback = false, $package = false) { if (!is_callable($callback)) { $callback = false; @@ -432,9 +429,8 @@ class PEAR_ErrorStack { * @see PEAR_ERRORSTACK_PUSHANDLOG, PEAR_ERRORSTACK_PUSH, PEAR_ERRORSTACK_LOG * @see staticPopCallback(), pushCallback() * @param string|array $cb - * @static */ - function staticPushCallback($cb) + public static function staticPushCallback($cb) { array_push($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'], $cb); } @@ -443,9 +439,8 @@ class PEAR_ErrorStack { * Remove a temporary overriding error callback * @see staticPushCallback() * @return array|string|false - * @static */ - function staticPopCallback() + public static function staticPopCallback() { $ret = array_pop($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK']); if (!is_array($GLOBALS['_PEAR_ERRORSTACK_OVERRIDE_CALLBACK'])) { @@ -604,11 +599,11 @@ class PEAR_ErrorStack { * to find error context * @return PEAR_Error|array if compatibility mode is on, a PEAR_Error is also * thrown. see docs for {@link push()} - * @static */ - function staticPush($package, $code, $level = 'error', $params = array(), - $msg = false, $repackage = false, $backtrace = false) - { + public static function staticPush( + $package, $code, $level = 'error', $params = array(), + $msg = false, $repackage = false, $backtrace = false + ) { $s = &PEAR_ErrorStack::singleton($package); if ($s->_contextCallback) { if (!$backtrace) { @@ -750,9 +745,8 @@ class PEAR_ErrorStack { * @param string|false Package name to check for errors * @param string Level name to check for a particular severity * @return boolean - * @static */ - function staticHasErrors($package = false, $level = false) + public static function staticHasErrors($package = false, $level = false) { if ($package) { if (!isset($GLOBALS['_PEAR_ERRORSTACK_SINGLETON'][$package])) { @@ -776,12 +770,13 @@ class PEAR_ErrorStack { * @param boolean $merge Set to return a flat array, not organized by package * @param array $sortfunc Function used to sort a merged array - default * sorts by time, and should be good for most cases - * @static + * * @return array */ - function staticGetErrors($purge = false, $level = false, $merge = false, - $sortfunc = array('PEAR_ErrorStack', '_sortErrors')) - { + public static function staticGetErrors( + $purge = false, $level = false, $merge = false, + $sortfunc = array('PEAR_ErrorStack', '_sortErrors') + ) { $ret = array(); if (!is_callable($sortfunc)) { $sortfunc = array('PEAR_ErrorStack', '_sortErrors'); @@ -806,7 +801,7 @@ class PEAR_ErrorStack { * Error sorting function, sorts by time * @access private */ - function _sortErrors($a, $b) + public static function _sortErrors($a, $b) { if ($a['time'] == $b['time']) { return 0; @@ -829,9 +824,8 @@ class PEAR_ErrorStack { * @param unused * @param integer backtrace frame. * @param array Results of debug_backtrace() - * @static */ - function getFileLine($code, $params, $backtrace = null) + public static function getFileLine($code, $params, $backtrace = null) { if ($backtrace === null) { return false; @@ -903,10 +897,10 @@ class PEAR_ErrorStack { * @param PEAR_ErrorStack * @param array * @param string|false Pre-generated error message template - * @static + * * @return string */ - function getErrorMessage(&$stack, $err, $template = false) + public static function getErrorMessage(&$stack, $err, $template = false) { if ($template) { $mainmsg = $template; diff --git a/WEB-INF/lib/pear/PEAR/Exception.php b/WEB-INF/lib/pear/PEAR/Exception.php index 4a0e7b86..0aba1710 100644 --- a/WEB-INF/lib/pear/PEAR/Exception.php +++ b/WEB-INF/lib/pear/PEAR/Exception.php @@ -13,7 +13,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Exception.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.3 */ @@ -89,7 +88,7 @@ * @author Greg Beaver * @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 Release 1.3.3 * diff --git a/WEB-INF/lib/pear/PEAR/FixPHP5PEARWarnings.php b/WEB-INF/lib/pear/PEAR/FixPHP5PEARWarnings.php deleted file mode 100644 index be5dc3ce..00000000 --- a/WEB-INF/lib/pear/PEAR/FixPHP5PEARWarnings.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Frontend.php b/WEB-INF/lib/pear/PEAR/Frontend.php index 531e541f..8c8c8c6b 100644 --- a/WEB-INF/lib/pear/PEAR/Frontend.php +++ b/WEB-INF/lib/pear/PEAR/Frontend.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Frontend.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -39,7 +38,7 @@ $GLOBALS['_PEAR_FRONTEND_SINGLETON'] = null; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -48,9 +47,8 @@ class PEAR_Frontend extends PEAR /** * Retrieve the frontend object * @return PEAR_Frontend_CLI|PEAR_Frontend_Web|PEAR_Frontend_Gtk - * @static */ - function &singleton($type = null) + public static function &singleton($type = null) { if ($type === null) { if (!isset($GLOBALS['_PEAR_FRONTEND_SINGLETON'])) { @@ -71,9 +69,8 @@ class PEAR_Frontend extends PEAR * _ => DIRECTORY_SEPARATOR (PEAR_Frontend_CLI is in PEAR/Frontend/CLI.php) * @param string $uiclass full class name * @return PEAR_Frontend - * @static */ - function &setFrontendClass($uiclass) + public static function &setFrontendClass($uiclass) { if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) && is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], $uiclass)) { @@ -88,7 +85,7 @@ class PEAR_Frontend extends PEAR } if (class_exists($uiclass)) { - $obj = &new $uiclass; + $obj = new $uiclass; // quick test to see if this class implements a few of the most // important frontend methods if (is_a($obj, 'PEAR_Frontend')) { @@ -111,9 +108,8 @@ class PEAR_Frontend extends PEAR * Frontends are expected to be a descendant of PEAR_Frontend * @param PEAR_Frontend * @return PEAR_Frontend - * @static */ - function &setFrontendObject($uiobject) + public static function &setFrontendObject($uiobject) { if (is_object($GLOBALS['_PEAR_FRONTEND_SINGLETON']) && is_a($GLOBALS['_PEAR_FRONTEND_SINGLETON'], get_class($uiobject))) { @@ -134,9 +130,8 @@ class PEAR_Frontend extends PEAR /** * @param string $path relative or absolute include path * @return boolean - * @static */ - function isIncludeable($path) + public static function isIncludeable($path) { if (file_exists($path) && is_readable($path)) { return true; diff --git a/WEB-INF/lib/pear/PEAR/Frontend/CLI.php b/WEB-INF/lib/pear/PEAR/Frontend/CLI.php index 340b99b7..f0723d03 100644 --- a/WEB-INF/lib/pear/PEAR/Frontend/CLI.php +++ b/WEB-INF/lib/pear/PEAR/Frontend/CLI.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: CLI.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -27,7 +26,7 @@ require_once 'PEAR/Frontend.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -47,9 +46,9 @@ class PEAR_Frontend_CLI extends PEAR_Frontend 'normal' => '', ); - function PEAR_Frontend_CLI() + function __construct() { - parent::PEAR(); + parent::__construct(); $term = getenv('TERM'); //(cox) $_ENV is empty for me in 4.1.1 if (function_exists('posix_isatty') && !posix_isatty(1)) { // output is being redirected to a file or through a pipe @@ -748,4 +747,4 @@ class PEAR_Frontend_CLI extends PEAR_Frontend { print $text; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Installer.php b/WEB-INF/lib/pear/PEAR/Installer.php index eb17ca79..d5cc7df6 100644 --- a/WEB-INF/lib/pear/PEAR/Installer.php +++ b/WEB-INF/lib/pear/PEAR/Installer.php @@ -12,7 +12,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Installer.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -36,7 +35,7 @@ define('PEAR_INSTALLER_NOBINARY', -240); * @author Greg Beaver * @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 Release 0.1 */ @@ -116,9 +115,9 @@ class PEAR_Installer extends PEAR_Downloader * * @access public */ - function PEAR_Installer(&$ui) + function __construct(&$ui) { - parent::PEAR_Common(); + parent::__construct($ui, array(), null); $this->setFrontendObject($ui); $this->debug = $this->config->get('verbose'); } @@ -589,7 +588,7 @@ class PEAR_Installer extends PEAR_Downloader foreach ($atts as $tag => $raw) { $tag = str_replace(array($pkg->getTasksNs() . ':', '-'), array('', '_'), $tag); $task = "PEAR_Task_$tag"; - $task = &new $task($this->config, $this, PEAR_TASK_INSTALL); + $task = new $task($this->config, $this, PEAR_TASK_INSTALL); if (!$task->isScript()) { // scripts are only handled after installation $task->init($raw, $attribs, $pkg->getLastInstalledVersion()); $res = $task->startSession($pkg, $contents, $final_dest_file); @@ -808,7 +807,10 @@ class PEAR_Installer extends PEAR_Downloader if (!empty($res)) { $new = $this->_registry->getPackage($result[1], $result[0]); $this->file_operations[$key] = false; - $this->log(3, "file $data[0] was scheduled for removal from {$this->pkginfo->getName()} but is owned by {$new->getChannel()}/{$new->getName()}, removal has been cancelled."); + $pkginfoName = $this->pkginfo->getName(); + $newChannel = $new->getChannel(); + $newPackage = $new->getName(); + $this->log(3, "file $data[0] was scheduled for removal from $pkginfoName but is owned by $newChannel/$newPackage, removal has been cancelled."); } } } @@ -1017,42 +1019,6 @@ class PEAR_Installer extends PEAR_Downloader return parent::mkDirHier($dir); } - // }}} - // {{{ download() - - /** - * Download any files and their dependencies, if necessary - * - * @param array a mixed list of package names, local files, or package.xml - * @param PEAR_Config - * @param array options from the command line - * @param array this is the array that will be populated with packages to - * install. Format of each entry: - * - * - * array('pkg' => 'package_name', 'file' => '/path/to/local/file', - * 'info' => array() // parsed package.xml - * ); - * - * @param array this will be populated with any error messages - * @param false private recursion variable - * @param false private recursion variable - * @param false private recursion variable - * @deprecated in favor of PEAR_Downloader - */ - function download($packages, $options, &$config, &$installpackages, - &$errors, $installed = false, $willinstall = false, $state = false) - { - // trickiness: initialize here - parent::PEAR_Downloader($this->ui, $options, $config); - $ret = parent::download($packages); - $errors = $this->getErrorMsgs(); - $installpackages = $this->getDownloadedPackages(); - trigger_error("PEAR Warning: PEAR_Installer::download() is deprecated " . - "in favor of PEAR_Downloader class", E_USER_WARNING); - return $ret; - } - // }}} // {{{ _parsePackageXml() @@ -1162,15 +1128,6 @@ class PEAR_Installer extends PEAR_Downloader $pkgname = $pkg->getName(); $channel = $pkg->getChannel(); - if (isset($this->_options['packagingroot'])) { - $regdir = $this->_prependPath( - $this->config->get('php_dir', null, 'pear.php.net'), - $this->_options['packagingroot']); - - $packrootphp_dir = $this->_prependPath( - $this->config->get('php_dir', null, $channel), - $this->_options['packagingroot']); - } if (isset($options['installroot'])) { $this->config->setInstallRoot($options['installroot']); @@ -1182,7 +1139,21 @@ class PEAR_Installer extends PEAR_Downloader $this->config->setInstallRoot(false); $this->_registry = &$this->config->getRegistry(); if (isset($this->_options['packagingroot'])) { - $installregistry = &new PEAR_Registry($regdir); + $regdir = $this->_prependPath( + $this->config->get('php_dir', null, 'pear.php.net'), + $this->_options['packagingroot']); + + $metadata_dir = $this->config->get('metadata_dir', null, 'pear.php.net'); + if ($metadata_dir) { + $metadata_dir = $this->_prependPath( + $metadata_dir, + $this->_options['packagingroot']); + } + $packrootphp_dir = $this->_prependPath( + $this->config->get('php_dir', null, $channel), + $this->_options['packagingroot']); + + $installregistry = new PEAR_Registry($regdir, false, false, $metadata_dir); if (!$installregistry->channelExists($channel, true)) { // we need to fake a channel-discover of this channel $chanobj = $this->_registry->getChannel($channel, true); @@ -1271,7 +1242,7 @@ class PEAR_Installer extends PEAR_Downloader } } - $pfk = &new PEAR_PackageFile($this->config); + $pfk = new PEAR_PackageFile($this->config); $parentpkg = &$pfk->fromArray($parentreg); $installregistry->updatePackage2($parentpkg); } @@ -1535,7 +1506,7 @@ class PEAR_Installer extends PEAR_Downloader { require_once 'PEAR/Builder.php'; $this->log(1, "$this->source_files source files, building"); - $bob = &new PEAR_Builder($this->ui); + $bob = new PEAR_Builder($this->ui); $bob->debug = $this->debug; $built = $bob->build($filelist, array(&$this, '_buildCallback')); if (PEAR::isError($built)) { @@ -1679,7 +1650,7 @@ class PEAR_Installer extends PEAR_Downloader require_once 'PEAR/Dependency2.php'; } - $depchecker = &new PEAR_Dependency2($this->config, $options, + $depchecker = new PEAR_Dependency2($this->config, $options, array('channel' => $channel, 'package' => $package), PEAR_VALIDATE_UNINSTALLING); $e = $depchecker->validatePackageUninstall($this); @@ -1820,4 +1791,4 @@ class PEAR_Installer extends PEAR_Downloader } // }}} -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role.php b/WEB-INF/lib/pear/PEAR/Installer/Role.php index 0c50fa79..0623424a 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Role.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -25,7 +24,7 @@ require_once 'PEAR/XMLParser.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -36,10 +35,8 @@ class PEAR_Installer_Role * * Never call this directly, it is called by the PEAR_Config constructor * @param PEAR_Config - * @access private - * @static */ - function initializeConfig(&$config) + public static function initializeConfig(&$config) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -59,9 +56,8 @@ class PEAR_Installer_Role * @param string role name * @param PEAR_Config * @return PEAR_Installer_Role_Common - * @static */ - function &factory($pkg, $role, &$config) + public static function &factory($pkg, $role, &$config) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -88,9 +84,8 @@ class PEAR_Installer_Role * @param string * @param bool clear cache * @return array - * @static */ - function getValidRoles($release, $clear = false) + public static function getValidRoles($release, $clear = false) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -123,9 +118,8 @@ class PEAR_Installer_Role * roles are actually fully bundled releases of a package * @param bool clear cache * @return array - * @static */ - function getInstallableRoles($clear = false) + public static function getInstallableRoles($clear = false) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -158,9 +152,8 @@ class PEAR_Installer_Role * so a tests file tests/file.phpt is installed into PackageName/tests/filepath.php * @param bool clear cache * @return array - * @static */ - function getBaseinstallRoles($clear = false) + public static function getBaseinstallRoles($clear = false) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -190,9 +183,8 @@ class PEAR_Installer_Role * like the "php" role. * @param bool clear cache * @return array - * @static */ - function getPhpRoles($clear = false) + public static function getPhpRoles($clear = false) { if (!isset($GLOBALS['_PEAR_INSTALLER_ROLES'])) { PEAR_Installer_Role::registerRoles(); @@ -226,10 +218,8 @@ class PEAR_Installer_Role * included. * * @return bool TRUE on success, a PEAR error on failure - * @access public - * @static */ - function registerRoles($dir = null) + public static function registerRoles($dir = null) { $GLOBALS['_PEAR_INSTALLER_ROLES'] = array(); $parser = new PEAR_XMLParser; diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Cfg.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Cfg.php index 76201224..903b1d64 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Cfg.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Cfg.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 2007-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Cfg.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.7.0 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @copyright 2007-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 Release 1.7.0 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Common.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Common.php index 23e7348d..df0b3c66 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Common.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Common.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2006 The PHP Group * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -24,7 +23,7 @@ * @author Greg Beaver * @copyright 1997-2006 The PHP Group * @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 Release 1.4.0a1 */ @@ -39,7 +38,7 @@ class PEAR_Installer_Role_Common /** * @param PEAR_Config */ - function PEAR_Installer_Role_Common(&$config) + function __construct(&$config) { $this->config = $config; } @@ -171,4 +170,4 @@ class PEAR_Installer_Role_Common return $roleInfo['phpextension']; } } -?> \ No newline at end of file +?> diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Data.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Data.php index e3b7fa2f..1a2c9c30 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Data.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Data.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Data.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Doc.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Doc.php index d592ffff..675cc877 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Doc.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Doc.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Doc.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Ext.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Ext.php index eceb0279..6224e2b8 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Ext.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Ext.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Ext.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Man.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Man.php new file mode 100644 index 00000000..5c3a842b --- /dev/null +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Man.php @@ -0,0 +1,28 @@ + + * @copyright 2011 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: $ + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.10.0 + */ + +/** + * @category pear + * @package PEAR + * @author Hannes Magnusson + * @copyright 2011 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.10.1 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.10.0 + */ +class PEAR_Installer_Role_Man extends PEAR_Installer_Role_Common {} +?> diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Man.xml b/WEB-INF/lib/pear/PEAR/Installer/Role/Man.xml new file mode 100644 index 00000000..ec2bd76c --- /dev/null +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Man.xml @@ -0,0 +1,15 @@ + + php + extsrc + extbin + zendextsrc + zendextbin + 1 + man_dir + 1 + + + + + + diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Php.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Php.php index e2abf44e..d1b97a86 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Php.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Php.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Php.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Script.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Script.php index b31469e4..f1eeda0b 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Script.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Script.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Script.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Src.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Src.php index 50370531..2c7ae214 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Src.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Src.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Src.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Test.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Test.php index 14c0e609..c19c5dc0 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Test.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Test.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Test.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @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 Release 1.4.0a1 */ diff --git a/WEB-INF/lib/pear/PEAR/Installer/Role/Www.php b/WEB-INF/lib/pear/PEAR/Installer/Role/Www.php index 11adeff8..42b197a9 100644 --- a/WEB-INF/lib/pear/PEAR/Installer/Role/Www.php +++ b/WEB-INF/lib/pear/PEAR/Installer/Role/Www.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 2007-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Www.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.7.0 */ @@ -20,7 +19,7 @@ * @author Greg Beaver * @copyright 2007-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 Release 1.7.0 */ diff --git a/WEB-INF/lib/pear/PEAR/PackageFile.php b/WEB-INF/lib/pear/PEAR/PackageFile.php index 7ae33628..8fb6e41f 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: PackageFile.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -35,7 +34,7 @@ define('PEAR_PACKAGEFILE_ERROR_INVALID_PACKAGEVERSION', 2); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -67,7 +66,7 @@ class PEAR_PackageFile * @param string @tmpdir Optional temporary directory for uncompressing * files */ - function PEAR_PackageFile(&$config, $debug = false) + function __construct(&$config, $debug = false) { $this->_config = $config; $this->_debug = $debug; @@ -489,4 +488,4 @@ class PEAR_PackageFile $info = PEAR::raiseError("Cannot open '$info' for parsing"); return $info; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v1.php b/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v1.php index 2f42f178..5a963787 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v1.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v1.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -29,7 +28,7 @@ require_once 'PEAR/PackageFile/v2.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -39,14 +38,14 @@ class PEAR_PackageFile_Generator_v1 * @var PEAR_PackageFile_v1 */ var $_packagefile; - function PEAR_PackageFile_Generator_v1(&$packagefile) + function __construct(&$packagefile) { $this->_packagefile = &$packagefile; } function getPackagerVersion() { - return '1.9.4'; + return '1.10.1'; } /** @@ -109,7 +108,7 @@ class PEAR_PackageFile_Generator_v1 // }}} $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, 'package.xml', true); if ($packagexml) { - $tar =& new Archive_Tar($dest_package, $compress); + $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($packagexml), '', $where); @@ -168,9 +167,6 @@ class PEAR_PackageFile_Generator_v1 */ function _fixXmlEncoding($string) { - if (version_compare(phpversion(), '5.0.0', 'lt')) { - $string = utf8_encode($string); - } return strtr($string, array( '&' => '&', '>' => '>', @@ -200,7 +196,7 @@ class PEAR_PackageFile_Generator_v1 ); $ret = "\n"; $ret .= "\n"; - $ret .= "\n" . + $ret .= "\n" . " $pkginfo[package]"; if (isset($pkginfo['extends'])) { $ret .= "\n$pkginfo[extends]"; @@ -1178,13 +1174,15 @@ class PEAR_PackageFile_Generator_v1 } if (count($min)) { // get the highest minimum - $min = array_pop($a = array_flip($min)); + $a = array_flip($min); + $min = array_pop($a); } else { $min = false; } if (count($max)) { // get the lowest maximum - $max = array_shift($a = array_flip($max)); + $a = array_flip($max); + $max = array_shift($a); } else { $max = false; } @@ -1250,13 +1248,15 @@ class PEAR_PackageFile_Generator_v1 } if (count($min)) { // get the highest minimum - $min = array_pop($a = array_flip($min)); + $a = array_flip($min); + $min = array_pop($a); } else { $min = false; } if (count($max)) { // get the lowest maximum - $max = array_shift($a = array_flip($max)); + $a = array_flip($max); + $max = array_shift($a); } else { $max = false; } @@ -1281,4 +1281,4 @@ class PEAR_PackageFile_Generator_v1 return $ret; } } -?> \ No newline at end of file +?> diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v2.php b/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v2.php index 4d202df2..24e89f3a 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v2.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/Generator/v2.php @@ -10,7 +10,6 @@ * @author Stephan Schmidt (original XML_Serializer code) * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -31,7 +30,7 @@ require_once 'XML/Util.php'; * @author Stephan Schmidt (original XML_Serializer code) * @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 Release 1.4.0a1 */ @@ -70,7 +69,7 @@ http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd', ), // attributes of the root tag 'attributesArray' => 'attribs', // all values in this key will be treated as attributes - 'contentName' => '_content', // this value will be used directly as content, instead of creating a new tag, may only be used in conjuction with attributesArray + 'contentName' => '_content', // this value will be used directly as content, instead of creating a new tag, may only be used in conjunction with attributesArray 'beautifyFilelist' => false, 'encoding' => 'UTF-8', ); @@ -100,7 +99,7 @@ http://pear.php.net/dtd/package-2.0.xsd', /** * @param PEAR_PackageFile_v2 */ - function PEAR_PackageFile_Generator_v2(&$packagefile) + function __construct(&$packagefile) { $this->_packagefile = &$packagefile; if (isset($this->_packagefile->encoding)) { @@ -113,7 +112,7 @@ http://pear.php.net/dtd/package-2.0.xsd', */ function getPackagerVersion() { - return '1.9.4'; + return '1.10.1'; } /** @@ -232,7 +231,7 @@ http://pear.php.net/dtd/package-2.0.xsd', array($this->_packagefile->getTasksNs() . ':', '-'), array('', '_'), $tag); $task = "PEAR_Task_$tag"; - $task = &new $task($this->_packagefile->_config, + $task = new $task($this->_packagefile->_config, $this->_packagefile->_logger, PEAR_TASK_PACKAGE); $task->init($raw, $atts, null); @@ -269,7 +268,7 @@ http://pear.php.net/dtd/package-2.0.xsd', $name = $pf1 !== null ? 'package2.xml' : 'package.xml'; $packagexml = $this->toPackageFile($where, PEAR_VALIDATE_PACKAGING, $name); if ($packagexml) { - $tar =& new Archive_Tar($dest_package, $compress); + $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($packagexml), '', $where); @@ -398,7 +397,7 @@ http://pear.php.net/dtd/package-2.0.xsd', $this->options['beautifyFilelist'] = true; } - $arr['attribs']['packagerversion'] = '1.9.4'; + $arr['attribs']['packagerversion'] = '1.10.1'; if ($this->serialize($arr, $options)) { return $this->_serializedData . "\n"; } @@ -869,12 +868,6 @@ http://pear.php.net/dtd/package-2.0.xsd', } if (is_scalar($tag['content']) || is_null($tag['content'])) { - if ($this->options['encoding'] == 'UTF-8' && - version_compare(phpversion(), '5.0.0', 'lt') - ) { - $tag['content'] = utf8_encode($tag['content']); - } - if ($replaceEntities === true) { $replaceEntities = XML_UTIL_ENTITIES_XML; } @@ -890,4 +883,4 @@ http://pear.php.net/dtd/package-2.0.xsd', } return $tag; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v1.php b/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v1.php index 23395dc7..8e08e0b4 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v1.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v1.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -91,7 +90,7 @@ class PEAR_PackageFile_Parser_v1 $code = xml_get_error_code($xp); $line = xml_get_current_line_number($xp); xml_parser_free($xp); - $a = &PEAR::raiseError(sprintf("XML error: %s at line %d", + $a = PEAR::raiseError(sprintf("XML error: %s at line %d", $str = xml_error_string($code), $line), 2); return $a; } diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v2.php b/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v2.php index a3ba7063..49a29f1a 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v2.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/Parser/v2.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -93,9 +92,9 @@ class PEAR_PackageFile_Parser_v2 extends PEAR_XMLParser * a subclass * @return PEAR_PackageFile_v2 */ - function &parse($data, $file, $archive = false, $class = 'PEAR_PackageFile_v2') + function parse($data, $file = null, $archive = false, $class = 'PEAR_PackageFile_v2') { - if (PEAR::isError($err = parent::parse($data, $file))) { + if (PEAR::isError($err = parent::parse($data))) { return $err; } diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/v1.php b/WEB-INF/lib/pear/PEAR/PackageFile/v1.php index 43e346bc..413db67d 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/v1.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/v1.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v1.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -275,7 +274,7 @@ define('PEAR_PACKAGEFILE_ERROR_INVALID_FILENAME', 52); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -346,9 +345,9 @@ class PEAR_PackageFile_v1 * @param bool determines whether to return a PEAR_Error object, or use the PEAR_ErrorStack * @param string Name of Error Stack class to use. */ - function PEAR_PackageFile_v1() + function __construct() { - $this->_stack = &new PEAR_ErrorStack('PEAR_PackageFile_v1'); + $this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v1'); $this->_stack->setErrorMessageTemplate($this->_getErrorMessage()); $this->_isValid = 0; } @@ -1308,7 +1307,7 @@ class PEAR_PackageFile_v1 if (!class_exists('PEAR_PackageFile_Generator_v1')) { require_once 'PEAR/PackageFile/Generator/v1.php'; } - $a = &new PEAR_PackageFile_Generator_v1($this); + $a = new PEAR_PackageFile_Generator_v1($this); return $a; } @@ -1331,7 +1330,7 @@ class PEAR_PackageFile_v1 if (!class_exists('Archive_Tar')) { require_once 'Archive/Tar.php'; } - $tar = &new Archive_Tar($this->_archiveFile); + $tar = new Archive_Tar($this->_archiveFile); $tar->pushErrorHandling(PEAR_ERROR_RETURN); if ($file != 'package.xml' && $file != 'package2.xml') { $file = $this->getPackage() . '-' . $this->getVersion() . '/' . $file; @@ -1466,15 +1465,6 @@ class PEAR_PackageFile_v1 $look_for = $token; continue 2; case T_STRING: - if (version_compare(zend_version(), '2.0', '<')) { - if (in_array(strtolower($data), - array('public', 'private', 'protected', 'abstract', - 'interface', 'implements', 'throw') - )) { - $this->_validateWarning(PEAR_PACKAGEFILE_ERROR_PHP5, - array($file)); - } - } if ($look_for == T_CLASS) { $current_class = $data; $current_class_level = $brace_level; diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/v2.php b/WEB-INF/lib/pear/PEAR/PackageFile/v2.php index 1ca412dc..ae0a1fa8 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/v2.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/v2.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: v2.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -23,7 +22,7 @@ require_once 'PEAR/ErrorStack.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -129,12 +128,21 @@ class PEAR_PackageFile_v2 /** * The constructor merely sets up the private error stack */ - function PEAR_PackageFile_v2() + function __construct() { $this->_stack = new PEAR_ErrorStack('PEAR_PackageFile_v2', false, null); $this->_isValid = false; } + /** + * PHP 4 style constructor for backwards compatibility. + * Used by PEAR_PackageFileManager2 + */ + public function PEAR_PackageFile_v2() + { + $this->__construct(); + } + /** * To make unit-testing easier * @param PEAR_Frontend_* @@ -145,7 +153,7 @@ class PEAR_PackageFile_v2 */ function &getPEARDownloader(&$i, $o, &$c) { - $z = &new PEAR_Downloader($i, $o, $c); + $z = new PEAR_Downloader($i, $o, $c); return $z; } @@ -163,7 +171,7 @@ class PEAR_PackageFile_v2 if (!class_exists('PEAR_Dependency2')) { require_once 'PEAR/Dependency2.php'; } - $z = &new PEAR_Dependency2($c, $o, $p, $s); + $z = new PEAR_Dependency2($c, $o, $p, $s); return $z; } @@ -564,7 +572,7 @@ class PEAR_PackageFile_v2 $atts = $filelist[$name]; foreach ($tasks as $tag => $raw) { $task = $this->getTask($tag); - $task = &new $task($this->_config, $common, PEAR_TASK_INSTALL); + $task = new $task($this->_config, $common, PEAR_TASK_INSTALL); if ($task->isScript()) { $ret[] = $filelist[$name]['installed_as']; } @@ -610,7 +618,7 @@ class PEAR_PackageFile_v2 $atts = $filelist[$name]; foreach ($tasks as $tag => $raw) { $taskname = $this->getTask($tag); - $task = &new $taskname($this->_config, $common, PEAR_TASK_INSTALL); + $task = new $taskname($this->_config, $common, PEAR_TASK_INSTALL); if (!$task->isScript()) { continue; // scripts are only handled after installation } @@ -1177,6 +1185,9 @@ class PEAR_PackageFile_v2 $contents['dir']['file'] = array($contents['dir']['file']); } foreach ($contents['dir']['file'] as $file) { + if (!isset($file['attribs']['name'])) { + continue; + } $name = $file['attribs']['name']; if (!$preserve) { $file = $file['attribs']; @@ -1854,7 +1865,7 @@ class PEAR_PackageFile_v2 return implode('', file($file)); } } else { // tgz - $tar = &new Archive_Tar($this->_archiveFile); + $tar = new Archive_Tar($this->_archiveFile); $tar->pushErrorHandling(PEAR_ERROR_RETURN); if ($file != 'package.xml' && $file != 'package2.xml') { $file = $this->getPackage() . '-' . $this->getVersion() . '/' . $file; @@ -1893,7 +1904,7 @@ class PEAR_PackageFile_v2 if (!class_exists('PEAR_PackageFile_Generator_v2')) { require_once 'PEAR/PackageFile/Generator/v2.php'; } - $a = &new PEAR_PackageFile_Generator_v2($this); + $a = new PEAR_PackageFile_Generator_v2($this); return $a; } diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/v2/Validator.php b/WEB-INF/lib/pear/PEAR/PackageFile/v2/Validator.php index 33c8eee3..eff9d03c 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/v2/Validator.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/v2/Validator.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Validator.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a8 */ @@ -21,7 +20,7 @@ * @author Greg Beaver * @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 Release 1.4.0a8 * @access private @@ -112,7 +111,8 @@ class PEAR_PackageFile_v2_Validator isset($test['dependencies']['required']) && isset($test['dependencies']['required']['pearinstaller']) && isset($test['dependencies']['required']['pearinstaller']['min']) && - version_compare('1.9.4', + '1.10.1' != '@package' . '_version@' && + version_compare('1.10.1', $test['dependencies']['required']['pearinstaller']['min'], '<') ) { $this->_pearVersionTooLow($test['dependencies']['required']['pearinstaller']['min']); @@ -1350,7 +1350,7 @@ class PEAR_PackageFile_v2_Validator $this->_stack->push(__FUNCTION__, 'error', array('version' => $version), 'This package.xml requires PEAR version %version% to parse properly, we are ' . - 'version 1.9.4'); + 'version 1.10.1'); } function _invalidTagOrder($oktags, $actual, $root) @@ -1737,7 +1737,7 @@ class PEAR_PackageFile_v2_Validator if (!is_array($info)) { $info = array($info); } - $pkg = &new PEAR_PackageFile($this->_pf->_config); + $pkg = new PEAR_PackageFile($this->_pf->_config); foreach ($info as $package) { if (!file_exists($dir_prefix . DIRECTORY_SEPARATOR . $package)) { $this->_fileNotFound($dir_prefix . DIRECTORY_SEPARATOR . $package); @@ -1875,7 +1875,7 @@ class PEAR_PackageFile_v2_Validator $pn = $this->_pf->getPackage(); $this->_stack->push(__FUNCTION__, 'warning', array('file' => $file, 'package' => $pn), - 'in %file%: Could not process file for unkown reasons,' . + 'in %file%: Could not process file for unknown reasons,' . ' possibly a PHP parse error in %file% from %package%'); } } @@ -1980,25 +1980,6 @@ class PEAR_PackageFile_v2_Validator $look_for = $token; continue 2; case T_STRING: - if (version_compare(zend_version(), '2.0', '<')) { - if (in_array(strtolower($data), - array('public', 'private', 'protected', 'abstract', - 'interface', 'implements', 'throw') - ) - ) { - if (isset($this->_stack)) { - $this->_stack->push(__FUNCTION__, 'warning', array( - 'file' => $file), - 'Error, PHP5 token encountered in %file%,' . - ' analysis should be in PHP5'); - } else { - PEAR::raiseError('Error: PHP5 token encountered in ' . $file . - 'packaging should be done in PHP 5'); - return false; - } - } - } - if ($look_for == T_CLASS) { $current_class = $data; $current_class_level = $brace_level; @@ -2045,7 +2026,7 @@ class PEAR_PackageFile_v2_Validator continue 2; case T_DOUBLE_COLON: $token = $tokens[$i - 1][0]; - if (!($token == T_WHITESPACE || $token == T_STRING || $token == T_STATIC)) { + if (!($token == T_WHITESPACE || $token == T_STRING || $token == T_STATIC || $token == T_VARIABLE)) { if (isset($this->_stack)) { $this->_stack->push(__FUNCTION__, 'warning', array('file' => $file), 'Parser error: invalid PHP found in file "%file%"'); @@ -2151,4 +2132,4 @@ class PEAR_PackageFile_v2_Validator return $providesret; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/PackageFile/v2/rw.php b/WEB-INF/lib/pear/PEAR/PackageFile/v2/rw.php index 58f76c55..f2b58e39 100644 --- a/WEB-INF/lib/pear/PEAR/PackageFile/v2/rw.php +++ b/WEB-INF/lib/pear/PEAR/PackageFile/v2/rw.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a8 */ @@ -23,7 +22,7 @@ require_once 'PEAR/PackageFile/v2.php'; * @author Greg Beaver * @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 Release 1.4.0a8 */ @@ -242,7 +241,7 @@ class PEAR_PackageFile_v2_rw extends PEAR_PackageFile_v2 } } foreach ($info as $i => $maintainer) { - if ($maintainer['user'] == $handle) { + if (is_array($maintainer) && $maintainer['user'] == $handle) { $found = $i; break 2; } diff --git a/WEB-INF/lib/pear/PEAR/Packager.php b/WEB-INF/lib/pear/PEAR/Packager.php index 8995a167..3303f4c1 100644 --- a/WEB-INF/lib/pear/PEAR/Packager.php +++ b/WEB-INF/lib/pear/PEAR/Packager.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Packager.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -31,7 +30,7 @@ require_once 'System.php'; * @author Greg Beaver * @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 Release 0.1 */ @@ -50,7 +49,7 @@ class PEAR_Packager extends PEAR_Common } PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN); - $pkg = &new PEAR_PackageFile($this->config, $this->debug); + $pkg = new PEAR_PackageFile($this->config, $this->debug); $pf = &$pkg->fromPackageFile($pkgfile, PEAR_VALIDATE_NORMAL); $main = &$pf; PEAR::staticPopErrorHandling(); diff --git a/WEB-INF/lib/pear/PEAR/REST.php b/WEB-INF/lib/pear/PEAR/REST.php index 34a804f2..c0dfeaa6 100644 --- a/WEB-INF/lib/pear/PEAR/REST.php +++ b/WEB-INF/lib/pear/PEAR/REST.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: REST.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -28,7 +27,7 @@ require_once 'PEAR/XMLParser.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -37,7 +36,7 @@ class PEAR_REST var $config; var $_options; - function PEAR_REST(&$config, $options = array()) + function __construct(&$config, $options = array()) { $this->config = &$config; $this->_options = $options; @@ -129,11 +128,13 @@ class PEAR_REST } if (isset($headers['content-type'])) { - switch ($headers['content-type']) { + $content_type = explode(";", $headers['content-type']); + $content_type = $content_type[0]; + switch ($content_type) { case 'text/xml' : case 'application/xml' : case 'text/plain' : - if ($headers['content-type'] === 'text/plain') { + if ($content_type === 'text/plain') { $check = substr($content, 0, 5); if ($check !== 'config->get('username', null, $channel); $password = $this->config->get('password', null, $channel); @@ -480,4 +493,4 @@ class PEAR_REST return $data; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/REST/10.php b/WEB-INF/lib/pear/PEAR/REST/10.php index 6ded7aea..affcc18e 100644 --- a/WEB-INF/lib/pear/PEAR/REST/10.php +++ b/WEB-INF/lib/pear/PEAR/REST/10.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: 10.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a12 */ @@ -27,7 +26,7 @@ require_once 'PEAR/REST.php'; * @author Greg Beaver * @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 Release 1.4.0a12 */ @@ -37,9 +36,9 @@ class PEAR_REST_10 * @var PEAR_REST */ var $_rest; - function PEAR_REST_10($config, $options = array()) + function __construct($config, $options = array()) { - $this->_rest = &new PEAR_REST($config, $options); + $this->_rest = new PEAR_REST($config, $options); } /** @@ -868,4 +867,4 @@ class PEAR_REST_10 return 1; } } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/REST/11.php b/WEB-INF/lib/pear/PEAR/REST/11.php index 831cfccd..9bd51ba6 100644 --- a/WEB-INF/lib/pear/PEAR/REST/11.php +++ b/WEB-INF/lib/pear/PEAR/REST/11.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: 11.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.3 */ @@ -27,7 +26,7 @@ require_once 'PEAR/REST.php'; * @author Greg Beaver * @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 Release 1.4.3 */ @@ -38,9 +37,9 @@ class PEAR_REST_11 */ var $_rest; - function PEAR_REST_11($config, $options = array()) + function __construct($config, $options = array()) { - $this->_rest = &new PEAR_REST($config, $options); + $this->_rest = new PEAR_REST($config, $options); } function listAll($base, $dostable, $basic = true, $searchpackage = false, $searchsummary = false, $channel = false) @@ -338,4 +337,4 @@ class PEAR_REST_11 return array_slice($states, $i + 1); } } -?> \ No newline at end of file +?> diff --git a/WEB-INF/lib/pear/PEAR/REST/13.php b/WEB-INF/lib/pear/PEAR/REST/13.php index 722ae0de..3855c6e0 100644 --- a/WEB-INF/lib/pear/PEAR/REST/13.php +++ b/WEB-INF/lib/pear/PEAR/REST/13.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: 13.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a12 */ @@ -28,7 +27,7 @@ require_once 'PEAR/REST/10.php'; * @author Greg Beaver * @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 Release 1.4.0a12 */ @@ -296,4 +295,102 @@ class PEAR_REST_13 extends PEAR_REST_10 return $this->_returnDownloadURL($base, $package, $release, $info, $found, $skippedphp, $channel); } + + /** + * List package upgrades but take the PHP version into account. + */ + function listLatestUpgrades($base, $pref_state, $installed, $channel, &$reg) + { + $packagelist = $this->_rest->retrieveData($base . 'p/packages.xml', false, false, $channel); + if (PEAR::isError($packagelist)) { + return $packagelist; + } + + $ret = array(); + if (!is_array($packagelist) || !isset($packagelist['p'])) { + return $ret; + } + + if (!is_array($packagelist['p'])) { + $packagelist['p'] = array($packagelist['p']); + } + + foreach ($packagelist['p'] as $package) { + if (!isset($installed[strtolower($package)])) { + continue; + } + + $inst_version = $reg->packageInfo($package, 'version', $channel); + $inst_state = $reg->packageInfo($package, 'release_state', $channel); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $info = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . + '/allreleases2.xml', false, false, $channel); + PEAR::popErrorHandling(); + if (PEAR::isError($info)) { + continue; // no remote releases + } + + if (!isset($info['r'])) { + continue; + } + + $release = $found = false; + if (!is_array($info['r']) || !isset($info['r'][0])) { + $info['r'] = array($info['r']); + } + + // $info['r'] is sorted by version number + usort($info['r'], array($this, '_sortReleasesByVersionNumber')); + foreach ($info['r'] as $release) { + if ($inst_version && version_compare($release['v'], $inst_version, '<=')) { + // not newer than the one installed + break; + } + if (version_compare($release['m'], phpversion(), '>')) { + // skip dependency releases that require a PHP version + // newer than our PHP version + continue; + } + + // new version > installed version + if (!$pref_state) { + // every state is a good state + $found = true; + break; + } else { + $new_state = $release['s']; + // if new state >= installed state: go + if (in_array($new_state, $this->betterStates($inst_state, true))) { + $found = true; + break; + } else { + // only allow to lower the state of package, + // if new state >= preferred state: go + if (in_array($new_state, $this->betterStates($pref_state, true))) { + $found = true; + break; + } + } + } + } + + if (!$found) { + continue; + } + + $relinfo = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/' . + $release['v'] . '.xml', false, false, $channel); + if (PEAR::isError($relinfo)) { + return $relinfo; + } + + $ret[$package] = array( + 'version' => $release['v'], + 'state' => $release['s'], + 'filesize' => $relinfo['f'], + ); + } + + return $ret; + } } \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Registry.php b/WEB-INF/lib/pear/PEAR/Registry.php index 35e17db4..c22d82f4 100644 --- a/WEB-INF/lib/pear/PEAR/Registry.php +++ b/WEB-INF/lib/pear/PEAR/Registry.php @@ -11,7 +11,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Registry.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -37,7 +36,7 @@ define('PEAR_REGISTRY_ERROR_CHANNEL_FILE', -6); * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -131,24 +130,27 @@ class PEAR_Registry extends PEAR * * @access public */ - function PEAR_Registry($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false, - $pecl_channel = false) + function __construct($pear_install_dir = PEAR_INSTALL_DIR, $pear_channel = false, + $pecl_channel = false, $pear_metadata_dir = '') { - parent::PEAR(); - $this->setInstallDir($pear_install_dir); + parent::__construct(); + $this->setInstallDir($pear_install_dir, $pear_metadata_dir); $this->_pearChannel = $pear_channel; $this->_peclChannel = $pecl_channel; $this->_config = false; } - function setInstallDir($pear_install_dir = PEAR_INSTALL_DIR) + function setInstallDir($pear_install_dir = PEAR_INSTALL_DIR, $pear_metadata_dir = '') { $ds = DIRECTORY_SEPARATOR; $this->install_dir = $pear_install_dir; - $this->channelsdir = $pear_install_dir.$ds.'.channels'; - $this->statedir = $pear_install_dir.$ds.'.registry'; - $this->filemap = $pear_install_dir.$ds.'.filemap'; - $this->lockfile = $pear_install_dir.$ds.'.lock'; + if (!$pear_metadata_dir) { + $pear_metadata_dir = $pear_install_dir; + } + $this->channelsdir = $pear_metadata_dir.$ds.'.channels'; + $this->statedir = $pear_metadata_dir.$ds.'.registry'; + $this->filemap = $pear_metadata_dir.$ds.'.filemap'; + $this->lockfile = $pear_metadata_dir.$ds.'.lock'; } function hasWriteAccess() @@ -181,7 +183,7 @@ class PEAR_Registry extends PEAR { $this->_config = &$config; if ($resetInstallDir) { - $this->setInstallDir($config->get('php_dir')); + $this->setInstallDir($config->get('php_dir'), $config->get('metadata_dir')); } } @@ -319,7 +321,7 @@ class PEAR_Registry extends PEAR $initializing = true; if (!$this->_config) { // never used? $file = OS_WINDOWS ? 'pear.ini' : '.pearrc'; - $this->_config = &new PEAR_Config($this->statedir . DIRECTORY_SEPARATOR . + $this->_config = new PEAR_Config($this->statedir . DIRECTORY_SEPARATOR . $file); $this->_config->setRegistry($this); $this->_config->set('php_dir', $this->install_dir); @@ -328,9 +330,9 @@ class PEAR_Registry extends PEAR $this->_dependencyDB = &PEAR_DependencyDB::singleton($this->_config); if (PEAR::isError($this->_dependencyDB)) { // attempt to recover by removing the dep db - if (file_exists($this->_config->get('php_dir', null, 'pear.php.net') . + if (file_exists($this->_config->get('metadata_dir', null, 'pear.php.net') . DIRECTORY_SEPARATOR . '.depdb')) { - @unlink($this->_config->get('php_dir', null, 'pear.php.net') . + @unlink($this->_config->get('metadata_dir', null, 'pear.php.net') . DIRECTORY_SEPARATOR . '.depdb'); } @@ -782,12 +784,9 @@ class PEAR_Registry extends PEAR } clearstatcache(); - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); $fsize = filesize($this->filemap); fclose($fp); $data = file_get_contents($this->filemap); - set_magic_quotes_runtime($rt); $tmp = unserialize($data); if (!$tmp && $fsize > 7) { return $this->raiseError('PEAR_Registry: invalid filemap data', PEAR_REGISTRY_ERROR_FORMAT, null, null, $data); @@ -1136,12 +1135,9 @@ class PEAR_Registry extends PEAR return null; } - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); clearstatcache(); $this->_closePackageFile($fp); $data = file_get_contents($this->_packageFileName($package, $channel)); - set_magic_quotes_runtime($rt); $data = unserialize($data); if ($key === null) { return $data; @@ -1175,12 +1171,9 @@ class PEAR_Registry extends PEAR return null; } - $rt = get_magic_quotes_runtime(); - set_magic_quotes_runtime(0); clearstatcache(); $this->_closeChannelFile($fp); $data = file_get_contents($this->_channelFileName($channel)); - set_magic_quotes_runtime($rt); $data = unserialize($data); return $data; } @@ -1447,7 +1440,7 @@ class PEAR_Registry extends PEAR $a = $this->_config; if (!$a) { - $this->_config = &new PEAR_Config; + $this->_config = new PEAR_Config; $this->_config->set('php_dir', $this->statedir); } @@ -1455,7 +1448,7 @@ class PEAR_Registry extends PEAR require_once 'PEAR/PackageFile.php'; } - $pkg = &new PEAR_PackageFile($this->_config); + $pkg = new PEAR_PackageFile($this->_config); $pf = &$pkg->fromArray($info); return $pf; } @@ -1934,12 +1927,12 @@ class PEAR_Registry extends PEAR * @param bool whether to strictly return raw channels (no aliases) * @return PEAR_ChannelFile|PEAR_Error */ - function &getChannel($channel, $noaliases = false) + function getChannel($channel, $noaliases = false) { if (PEAR::isError($e = $this->_lock(LOCK_SH))) { return $e; } - $ret = &$this->_getChannel($channel, $noaliases); + $ret = $this->_getChannel($channel, $noaliases); $this->_unlock(); if (!$ret) { return PEAR::raiseError('Unknown channel: ' . $channel); @@ -2392,4 +2385,4 @@ class PEAR_Registry extends PEAR } return $ret; } -} \ No newline at end of file +} diff --git a/WEB-INF/lib/pear/PEAR/RunTest.php b/WEB-INF/lib/pear/PEAR/RunTest.php index 51824906..59dedbf9 100644 --- a/WEB-INF/lib/pear/PEAR/RunTest.php +++ b/WEB-INF/lib/pear/PEAR/RunTest.php @@ -10,7 +10,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: RunTest.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.3.3 */ @@ -38,7 +37,7 @@ putenv("PHP_PEAR_RUNTESTS=1"); * @author Greg Beaver * @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 Release 1.3.3 */ @@ -60,7 +59,6 @@ class PEAR_RunTest var $ini_overwrites = array( 'output_handler=', 'open_basedir=', - 'safe_mode=0', 'disable_functions=', 'output_buffering=Off', 'display_errors=1', @@ -75,7 +73,6 @@ class PEAR_RunTest 'error_append_string=', 'auto_prepend_file=', 'auto_append_file=', - 'magic_quotes_runtime=0', 'xdebug.default_enable=0', 'allow_url_fopen=1', ); @@ -84,7 +81,7 @@ class PEAR_RunTest * An object that supports the PEAR_Common->log() signature, or null * @param PEAR_Common|null */ - function PEAR_RunTest($logger = null, $options = array()) + function __construct($logger = null, $options = array()) { if (!defined('E_DEPRECATED')) { define('E_DEPRECATED', 0); @@ -115,19 +112,11 @@ class PEAR_RunTest function system_with_timeout($commandline, $env = null, $stdin = null) { $data = ''; - if (version_compare(phpversion(), '5.0.0', '<')) { - $proc = proc_open($commandline, array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ), $pipes); - } else { - $proc = proc_open($commandline, array( - 0 => array('pipe', 'r'), - 1 => array('pipe', 'w'), - 2 => array('pipe', 'w') - ), $pipes, null, $env, array('suppress_errors' => true)); - } + $proc = proc_open($commandline, array( + 0 => array('pipe', 'r'), + 1 => array('pipe', 'w'), + 2 => array('pipe', 'w') + ), $pipes, null, $env, array('suppress_errors' => true)); if (!$proc) { return false; @@ -231,12 +220,7 @@ class PEAR_RunTest function _preparePhpBin($php, $file, $ini_settings) { $file = escapeshellarg($file); - // This was fixed in php 5.3 and is not needed after that - if (OS_WINDOWS && version_compare(PHP_VERSION, '5.3', '<')) { - $cmd = '"'.escapeshellarg($php).' '.$ini_settings.' -f ' . $file .'"'; - } else { - $cmd = $php . $ini_settings . ' -f ' . $file; - } + $cmd = $php . $ini_settings . ' -f ' . $file; return $cmd; } @@ -275,10 +259,8 @@ class PEAR_RunTest */ function run($file, $ini_settings = array(), $test_number = 1) { - if (isset($this->_savephp)) { - $this->_php = $this->_savephp; - unset($this->_savephp); - } + $this->_restorePHPBinary(); + if (empty($this->_options['cgi'])) { // try to see if php-cgi is in the path $res = $this->system_with_timeout('php-cgi -v'); @@ -340,7 +322,7 @@ class PEAR_RunTest } return 'SKIPPED'; } - $this->_savephp = $this->_php; + $this->_savePHPBinary(); $this->_php = $this->_options['cgi']; } @@ -494,8 +476,6 @@ class PEAR_RunTest } chdir($cwd); // in case the test moves us around - $this->_testCleanup($section_text, $temp_clean); - /* when using CGI, strip the headers from the output */ $output = $this->_stripHeadersCGI($output); @@ -516,6 +496,9 @@ class PEAR_RunTest $output .= "\n====EXPECTHEADERS FAILURE====:\n$changed"; } } + + $this->_testCleanup($section_text, $temp_clean); + // Does the output match what is expected? do { if (isset($section_text['EXPECTF']) || isset($section_text['EXPECTREGEX'])) { @@ -639,6 +622,11 @@ class PEAR_RunTest $expectf = isset($section_text['EXPECTF']) ? $wanted_re : null; $data = $this->generate_diff($wanted, $output, $returns, $expectf); $res = $this->_writeLog($diff_filename, $data); + if (isset($this->_options['showdiff'])) { + $this->_logger->log(0, "========DIFF========"); + $this->_logger->log(0, $data); + $this->_logger->log(0, "========DONE========"); + } if (PEAR::isError($res)) { return $res; } @@ -954,6 +942,8 @@ $text function _testCleanup($section_text, $temp_clean) { if ($section_text['CLEAN']) { + $this->_restorePHPBinary(); + // perform test cleanup $this->save_text($temp_clean, $section_text['CLEAN']); $output = $this->system_with_timeout("$this->_php $temp_clean 2>&1"); @@ -965,4 +955,18 @@ $text } } } + + function _savePHPBinary() + { + $this->_savephp = $this->_php; + } + + function _restorePHPBinary() + { + if (isset($this->_savephp)) + { + $this->_php = $this->_savephp; + unset($this->_savephp); + } + } } diff --git a/WEB-INF/lib/pear/PEAR/Task/Common.php b/WEB-INF/lib/pear/PEAR/Task/Common.php index 5b99c2e4..ebb71dc8 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Common.php +++ b/WEB-INF/lib/pear/PEAR/Task/Common.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Common.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a1 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 */ /**#@+ * Error codes for task validation routines @@ -42,14 +41,15 @@ define('PEAR_TASK_PACKAGEANDINSTALL', 3); * This will first replace any instance of @data-dir@ in the test.php file * with the path to the current data directory. Then, it will include the * test.php file and run the script it contains to configure the package post-installation. - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.4 - * @link http://pear.php.net/package/PEAR - * @since Class available since Release 1.4.0a1 + * + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.10.1 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 * @abstract */ class PEAR_Task_Common @@ -62,34 +62,35 @@ class PEAR_Task_Common * changes directly to disk * * Child task classes must override this property. + * * @access protected */ - var $type = 'simple'; + protected $type = 'simple'; /** * Determines which install phase this task is executed under */ - var $phase = PEAR_TASK_INSTALL; + public $phase = PEAR_TASK_INSTALL; /** * @access protected */ - var $config; + protected $config; /** * @access protected */ - var $registry; + protected $registry; /** * @access protected */ - var $logger; + public $logger; /** * @access protected */ - var $installphase; + protected $installphase; /** * @param PEAR_Config * @param PEAR_Common */ - function PEAR_Task_Common(&$config, &$logger, $phase) + function __construct(&$config, &$logger, $phase) { $this->config = &$config; $this->registry = &$config->getRegistry(); @@ -102,101 +103,105 @@ class PEAR_Task_Common /** * Validate the basic contents of a task tag. + * * @param PEAR_PackageFile_v2 * @param array * @param PEAR_Config * @param array the entire parsed tag + * * @return true|array On error, return an array in format: - * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...]) + * array(PEAR_TASK_ERROR_???[, param1][, param2][, ...]) + * + * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in + * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and + * an array of legal values in * - * For PEAR_TASK_ERROR_MISSING_ATTRIB, pass the attribute name in - * For PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, pass the attribute name and an array - * of legal values in - * @static * @abstract */ - function validateXml($pkg, $xml, $config, $fileXml) + public static function validateXml($pkg, $xml, $config, $fileXml) { } /** * Initialize a task instance with the parameters - * @param array raw, parsed xml - * @param array attributes from the tag containing this task - * @param string|null last installed version of this package + * + * @param array raw, parsed xml + * @param array attributes from the tag containing this task + * @param string|null last installed version of this package * @abstract */ - function init($xml, $fileAttributes, $lastVersion) + public function init($xml, $fileAttributes, $lastVersion) { } /** - * Begin a task processing session. All multiple tasks will be processed after each file - * has been successfully installed, all simple tasks should perform their task here and - * return any errors using the custom throwError() method to allow forward compatibility + * Begin a task processing session. All multiple tasks will be processed + * after each file has been successfully installed, all simple tasks should + * perform their task here and return any errors using the custom + * throwError() method to allow forward compatibility * * This method MUST NOT write out any changes to disk - * @param PEAR_PackageFile_v2 - * @param string file contents - * @param string the eventual final file location (informational only) - * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail - * (use $this->throwError), otherwise return the new contents + * + * @param PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) + * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail + * (use $this->throwError), otherwise return the new contents * @abstract */ - function startSession($pkg, $contents, $dest) + public function startSession($pkg, $contents, $dest) { } /** - * This method is used to process each of the tasks for a particular multiple class - * type. Simple tasks need not implement this method. - * @param array an array of tasks - * @access protected - * @static - * @abstract + * This method is used to process each of the tasks for a particular + * multiple class type. Simple tasks need not implement this method. + * + * @param array an array of tasks + * @access protected */ - function run($tasks) + public static function run($tasks) { } /** - * @static * @final */ - function hasPostinstallTasks() + public static function hasPostinstallTasks() { return isset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); } - /** - * @static - * @final - */ - function runPostinstallTasks() - { - foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) { - $err = call_user_func(array($class, 'run'), - $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class]); - if ($err) { - return PEAR_Task_Common::throwError($err); - } - } - unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); + /** + * @final + */ + public static function runPostinstallTasks() + { + foreach ($GLOBALS['_PEAR_TASK_POSTINSTANCES'] as $class => $tasks) { + $err = call_user_func( + array($class, 'run'), + $GLOBALS['_PEAR_TASK_POSTINSTANCES'][$class] + ); + if ($err) { + return PEAR_Task_Common::throwError($err); + } + } + unset($GLOBALS['_PEAR_TASK_POSTINSTANCES']); } /** * Determines whether a role is a script * @return bool */ - function isScript() + public function isScript() { - return $this->type == 'script'; + return $this->type == 'script'; } - function throwError($msg, $code = -1) + public function throwError($msg, $code = -1) { include_once 'PEAR.php'; + return PEAR::raiseError($msg, $code); } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript.php b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript.php index e43ecca4..950deb5c 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript.php +++ b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Postinstallscript.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a1 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 */ /** * Base class @@ -22,85 +21,95 @@ require_once 'PEAR/Task/Common.php'; * * Note that post-install scripts are handled separately from installation, by the * "pear run-scripts" command - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.4 - * @link http://pear.php.net/package/PEAR - * @since Class available since Release 1.4.0a1 + * + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.10.1 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 */ class PEAR_Task_Postinstallscript extends PEAR_Task_Common { - var $type = 'script'; - var $_class; - var $_params; - var $_obj; + public $type = 'script'; + public $_class; + public $_params; + public $_obj; /** * * @var PEAR_PackageFile_v2 */ - var $_pkg; - var $_contents; - var $phase = PEAR_TASK_INSTALL; + public $_pkg; + public $_contents; + public $phase = PEAR_TASK_INSTALL; /** * Validate the raw xml at parsing-time. * * This also attempts to validate the script to make sure it meets the criteria * for a post-install script - * @param PEAR_PackageFile_v2 - * @param array The XML contents of the tag - * @param PEAR_Config - * @param array the entire parsed tag - * @static + * + * @param PEAR_PackageFile_v2 + * @param array The XML contents of the tag + * @param PEAR_Config + * @param array the entire parsed tag */ - function validateXml($pkg, $xml, $config, $fileXml) + public static function validateXml($pkg, $xml, $config, $fileXml) { if ($fileXml['role'] != 'php') { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" must be role="php"'); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" must be role="php"', ); } PEAR::pushErrorHandling(PEAR_ERROR_RETURN); $file = $pkg->getFileContents($fileXml['name']); if (PEAR::isError($file)) { PEAR::popErrorHandling(); - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" is not valid: ' . - $file->getMessage()); + + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" is not valid: '. + $file->getMessage(), ); } elseif ($file === null) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" could not be retrieved for processing!'); + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" could not be retrieved for processing!', ); } else { $analysis = $pkg->analyzeSourceCode($file, true); if (!$analysis) { PEAR::popErrorHandling(); $warnings = ''; foreach ($pkg->getValidationWarnings() as $warn) { - $warnings .= $warn['message'] . "\n"; + $warnings .= $warn['message']."\n"; } - return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "' . - $fileXml['name'] . '" failed: ' . $warnings); + + return array(PEAR_TASK_ERROR_INVALID, 'Analysis of post-install script "'. + $fileXml['name'].'" failed: '.$warnings, ); } if (count($analysis['declared_classes']) != 1) { PEAR::popErrorHandling(); - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" must declare exactly 1 class'); + + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" must declare exactly 1 class', ); } $class = $analysis['declared_classes'][0]; - if ($class != str_replace(array('/', '.php'), array('_', ''), - $fileXml['name']) . '_postinstall') { + if ($class != str_replace( + array('/', '.php'), array('_', ''), + $fileXml['name'] + ).'_postinstall') { PEAR::popErrorHandling(); - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" class "' . $class . '" must be named "' . - str_replace(array('/', '.php'), array('_', ''), - $fileXml['name']) . '_postinstall"'); + + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" class "'.$class.'" must be named "'. + str_replace( + array('/', '.php'), array('_', ''), + $fileXml['name'] + ).'_postinstall"', ); } if (!isset($analysis['declared_methods'][$class])) { PEAR::popErrorHandling(); - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" must declare methods init() and run()'); + + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" must declare methods init() and run()', ); } $methods = array('init' => 0, 'run' => 1); foreach ($analysis['declared_methods'][$class] as $method) { @@ -110,129 +119,137 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common } if (count($methods)) { PEAR::popErrorHandling(); - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" must declare methods init() and run()'); + + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" must declare methods init() and run()', ); } } PEAR::popErrorHandling(); $definedparams = array(); - $tasksNamespace = $pkg->getTasksNs() . ':'; - if (!isset($xml[$tasksNamespace . 'paramgroup']) && isset($xml['paramgroup'])) { + $tasksNamespace = $pkg->getTasksNs().':'; + if (!isset($xml[$tasksNamespace.'paramgroup']) && isset($xml['paramgroup'])) { // in order to support the older betas, which did not expect internal tags // to also use the namespace $tasksNamespace = ''; } - if (isset($xml[$tasksNamespace . 'paramgroup'])) { - $params = $xml[$tasksNamespace . 'paramgroup']; + if (isset($xml[$tasksNamespace.'paramgroup'])) { + $params = $xml[$tasksNamespace.'paramgroup']; if (!is_array($params) || !isset($params[0])) { $params = array($params); } foreach ($params as $param) { - if (!isset($param[$tasksNamespace . 'id'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" must have ' . - 'an ' . $tasksNamespace . 'id> tag'); + if (!isset($param[$tasksNamespace.'id'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" must have '. + 'an '.$tasksNamespace.'id> tag', ); } - if (isset($param[$tasksNamespace . 'name'])) { - if (!in_array($param[$tasksNamespace . 'name'], $definedparams)) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" ' . $tasksNamespace . - 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . - '" parameter "' . $param[$tasksNamespace . 'name'] . - '" has not been previously defined'); + if (isset($param[$tasksNamespace.'name'])) { + if (!in_array($param[$tasksNamespace.'name'], $definedparams)) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" '.$tasksNamespace. + 'paramgroup> id "'.$param[$tasksNamespace.'id']. + '" parameter "'.$param[$tasksNamespace.'name']. + '" has not been previously defined', ); } - if (!isset($param[$tasksNamespace . 'conditiontype'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" ' . $tasksNamespace . - 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . - '" must have a ' . $tasksNamespace . - 'conditiontype> tag containing either "=", ' . - '"!=", or "preg_match"'); + if (!isset($param[$tasksNamespace.'conditiontype'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" '.$tasksNamespace. + 'paramgroup> id "'.$param[$tasksNamespace.'id']. + '" must have a '.$tasksNamespace. + 'conditiontype> tag containing either "=", '. + '"!=", or "preg_match"', ); } - if (!in_array($param[$tasksNamespace . 'conditiontype'], - array('=', '!=', 'preg_match'))) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" ' . $tasksNamespace . - 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . - '" must have a ' . $tasksNamespace . - 'conditiontype> tag containing either "=", ' . - '"!=", or "preg_match"'); + if (!in_array( + $param[$tasksNamespace.'conditiontype'], + array('=', '!=', 'preg_match') + )) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" '.$tasksNamespace. + 'paramgroup> id "'.$param[$tasksNamespace.'id']. + '" must have a '.$tasksNamespace. + 'conditiontype> tag containing either "=", '. + '"!=", or "preg_match"', ); } - if (!isset($param[$tasksNamespace . 'value'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" ' . $tasksNamespace . - 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . - '" must have a ' . $tasksNamespace . - 'value> tag containing expected parameter value'); + if (!isset($param[$tasksNamespace.'value'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" '.$tasksNamespace. + 'paramgroup> id "'.$param[$tasksNamespace.'id']. + '" must have a '.$tasksNamespace. + 'value> tag containing expected parameter value', ); } } - if (isset($param[$tasksNamespace . 'instructions'])) { - if (!is_string($param[$tasksNamespace . 'instructions'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" ' . $tasksNamespace . - 'paramgroup> id "' . $param[$tasksNamespace . 'id'] . - '" ' . $tasksNamespace . 'instructions> must be simple text'); + if (isset($param[$tasksNamespace.'instructions'])) { + if (!is_string($param[$tasksNamespace.'instructions'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" '.$tasksNamespace. + 'paramgroup> id "'.$param[$tasksNamespace.'id']. + '" '.$tasksNamespace.'instructions> must be simple text', ); } } - if (!isset($param[$tasksNamespace . 'param'])) { + if (!isset($param[$tasksNamespace.'param'])) { continue; // is no longer required } - $subparams = $param[$tasksNamespace . 'param']; + $subparams = $param[$tasksNamespace.'param']; if (!is_array($subparams) || !isset($subparams[0])) { $subparams = array($subparams); } foreach ($subparams as $subparam) { - if (!isset($subparam[$tasksNamespace . 'name'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" parameter for ' . - $tasksNamespace . 'paramgroup> id "' . - $param[$tasksNamespace . 'id'] . '" must have ' . - 'a ' . $tasksNamespace . 'name> tag'); + if (!isset($subparam[$tasksNamespace.'name'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" parameter for '. + $tasksNamespace.'paramgroup> id "'. + $param[$tasksNamespace.'id'].'" must have '. + 'a '.$tasksNamespace.'name> tag', ); } - if (!preg_match('/[a-zA-Z0-9]+/', - $subparam[$tasksNamespace . 'name'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" parameter "' . - $subparam[$tasksNamespace . 'name'] . - '" for ' . $tasksNamespace . 'paramgroup> id "' . - $param[$tasksNamespace . 'id'] . - '" is not a valid name. Must contain only alphanumeric characters'); + if (!preg_match( + '/[a-zA-Z0-9]+/', + $subparam[$tasksNamespace.'name'] + )) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" parameter "'. + $subparam[$tasksNamespace.'name']. + '" for '.$tasksNamespace.'paramgroup> id "'. + $param[$tasksNamespace.'id']. + '" is not a valid name. Must contain only alphanumeric characters', ); } - if (!isset($subparam[$tasksNamespace . 'prompt'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" parameter "' . - $subparam[$tasksNamespace . 'name'] . - '" for ' . $tasksNamespace . 'paramgroup> id "' . - $param[$tasksNamespace . 'id'] . - '" must have a ' . $tasksNamespace . 'prompt> tag'); + if (!isset($subparam[$tasksNamespace.'prompt'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" parameter "'. + $subparam[$tasksNamespace.'name']. + '" for '.$tasksNamespace.'paramgroup> id "'. + $param[$tasksNamespace.'id']. + '" must have a '.$tasksNamespace.'prompt> tag', ); } - if (!isset($subparam[$tasksNamespace . 'type'])) { - return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "' . - $fileXml['name'] . '" parameter "' . - $subparam[$tasksNamespace . 'name'] . - '" for ' . $tasksNamespace . 'paramgroup> id "' . - $param[$tasksNamespace . 'id'] . - '" must have a ' . $tasksNamespace . 'type> tag'); + if (!isset($subparam[$tasksNamespace.'type'])) { + return array(PEAR_TASK_ERROR_INVALID, 'Post-install script "'. + $fileXml['name'].'" parameter "'. + $subparam[$tasksNamespace.'name']. + '" for '.$tasksNamespace.'paramgroup> id "'. + $param[$tasksNamespace.'id']. + '" must have a '.$tasksNamespace.'type> tag', ); } - $definedparams[] = $param[$tasksNamespace . 'id'] . '::' . - $subparam[$tasksNamespace . 'name']; + $definedparams[] = $param[$tasksNamespace.'id'].'::'. + $subparam[$tasksNamespace.'name']; } } } + return true; } /** * Initialize a task instance with the parameters - * @param array raw, parsed xml - * @param array attributes from the tag containing this task - * @param string|null last installed version of this package, if any (useful for upgrades) + * @param array $xml raw, parsed xml + * @param array $fileattribs attributes from the tag containing + * this task + * @param string|null $lastversion last installed version of this package, + * if any (useful for upgrades) */ - function init($xml, $fileattribs, $lastversion) + public function init($xml, $fileattribs, $lastversion) { $this->_class = str_replace('/', '_', $fileattribs['name']); $this->_filename = $fileattribs['name']; - $this->_class = str_replace ('.php', '', $this->_class) . '_postinstall'; + $this->_class = str_replace('.php', '', $this->_class).'_postinstall'; $this->_params = $xml; $this->_lastversion = $lastversion; } @@ -242,7 +259,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common * * @access private */ - function _stripNamespace($params = null) + public function _stripNamespace($params = null) { if ($params === null) { $params = array(); @@ -253,7 +270,7 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common if (is_array($param)) { $param = $this->_stripNamespace($param); } - $params[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param; + $params[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param; } $this->_params = $params; } else { @@ -262,21 +279,24 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common if (is_array($param)) { $param = $this->_stripNamespace($param); } - $newparams[str_replace($this->_pkg->getTasksNs() . ':', '', $i)] = $param; + $newparams[str_replace($this->_pkg->getTasksNs().':', '', $i)] = $param; } + return $newparams; } } /** - * Unlike other tasks, the installed file name is passed in instead of the file contents, - * because this task is handled post-installation - * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 - * @param string file name + * Unlike other tasks, the installed file name is passed in instead of the + * file contents, because this task is handled post-installation + * + * @param mixed $pkg PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string $contents file name + * * @return bool|PEAR_Error false to skip this file, PEAR_Error to fail - * (use $this->throwError) + * (use $this->throwError) */ - function startSession($pkg, $contents) + public function startSession($pkg, $contents) { if ($this->installphase != PEAR_TASK_INSTALL) { return false; @@ -284,40 +304,46 @@ class PEAR_Task_Postinstallscript extends PEAR_Task_Common // remove the tasks: namespace if present $this->_pkg = $pkg; $this->_stripNamespace(); - $this->logger->log(0, 'Including external post-installation script "' . - $contents . '" - any errors are in this script'); + $this->logger->log( + 0, 'Including external post-installation script "'. + $contents.'" - any errors are in this script' + ); include_once $contents; if (class_exists($this->_class)) { $this->logger->log(0, 'Inclusion succeeded'); } else { - return $this->throwError('init of post-install script class "' . $this->_class - . '" failed'); + return $this->throwError( + 'init of post-install script class "'.$this->_class + .'" failed' + ); } - $this->_obj = new $this->_class; - $this->logger->log(1, 'running post-install script "' . $this->_class . '->init()"'); + $this->_obj = new $this->_class(); + $this->logger->log(1, 'running post-install script "'.$this->_class.'->init()"'); PEAR::pushErrorHandling(PEAR_ERROR_RETURN); $res = $this->_obj->init($this->config, $pkg, $this->_lastversion); PEAR::popErrorHandling(); if ($res) { $this->logger->log(0, 'init succeeded'); } else { - return $this->throwError('init of post-install script "' . $this->_class . - '->init()" failed'); + return $this->throwError( + 'init of post-install script "'.$this->_class. + '->init()" failed' + ); } $this->_contents = $contents; + return true; } /** * No longer used - * @see PEAR_PackageFile_v2::runPostinstallScripts() - * @param array an array of tasks - * @param string install or upgrade + * + * @see PEAR_PackageFile_v2::runPostinstallScripts() + * @param array an array of tasks + * @param string install or upgrade * @access protected - * @static */ - function run() + public static function run() { } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php index 8f358bf2..66296006 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php +++ b/WEB-INF/lib/pear/PEAR/Task/Postinstallscript/rw.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a10 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 */ /** * Base class @@ -24,7 +23,7 @@ require_once 'PEAR/Task/Postinstallscript.php'; * @author Greg Beaver * @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 Release 1.4.0a10 */ @@ -35,30 +34,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * @var PEAR_PackageFile_v2_rw */ - var $_pkg; + public $_pkg; /** * Enter description here... * - * @param PEAR_PackageFile_v2_rw $pkg - * @param PEAR_Config $config - * @param PEAR_Frontend $logger - * @param array $fileXml + * @param PEAR_PackageFile_v2_rw $pkg Package + * @param PEAR_Config $config Config + * @param PEAR_Frontend $logger Logger + * @param array $fileXml XML + * * @return PEAR_Task_Postinstallscript_rw */ - function PEAR_Task_Postinstallscript_rw(&$pkg, &$config, &$logger, $fileXml) + function __construct(&$pkg, &$config, &$logger, $fileXml) { - parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + parent::__construct($config, $logger, PEAR_TASK_PACKAGE); $this->_contents = $fileXml; $this->_pkg = &$pkg; $this->_params = array(); } - function validate() + public function validate() { return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); } - function getName() + public function getName() { return 'postinstallscript'; } @@ -73,30 +73,31 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * Use {@link addConditionTypeGroup()} to add a containing * a tag - * @param string $id id as seen by the script - * @param array|false $params array of getParam() calls, or false for no params + * + * @param string $id id as seen by the script + * @param array|false $params array of getParam() calls, or false for no params * @param string|false $instructions */ - function addParamGroup($id, $params = false, $instructions = false) + public function addParamGroup($id, $params = false, $instructions = false) { if ($params && isset($params[0]) && !isset($params[1])) { $params = $params[0]; } $stuff = array( - $this->_pkg->getTasksNs() . ':id' => $id, + $this->_pkg->getTasksNs().':id' => $id, ); if ($instructions) { - $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions; } if ($params) { - $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + $stuff[$this->_pkg->getTasksNs().':param'] = $params; } - $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff; } /** - * add a complex to the post-install script with conditions + * Add a complex to the post-install script with conditions * * This inserts a with * @@ -107,63 +108,75 @@ class PEAR_Task_Postinstallscript_rw extends PEAR_Task_Postinstallscript * * Use {@link addParamGroup()} to add a simple * - * @param string $id id as seen by the script - * @param string $oldgroup id of the section referenced by - * - * @param string $param name of the from the older section referenced - * by - * @param string $value value to match of the parameter - * @param string $conditiontype one of '=', '!=', 'preg_match' - * @param array|false $params array of getParam() calls, or false for no params + * @param string $id id as seen by the script + * @param string $oldgroup id of the section referenced by + * + * @param string $param name of the from the older section referenced + * by + * @param string $value value to match of the parameter + * @param string $conditiontype one of '=', '!=', 'preg_match' + * @param array|false $params array of getParam() calls, or false for no params * @param string|false $instructions */ - function addConditionTypeGroup($id, $oldgroup, $param, $value, $conditiontype = '=', - $params = false, $instructions = false) - { + public function addConditionTypeGroup($id, + $oldgroup, + $param, + $value, + $conditiontype = '=', + $params = false, + $instructions = false + ) { if ($params && isset($params[0]) && !isset($params[1])) { $params = $params[0]; } $stuff = array( - $this->_pkg->getTasksNs() . ':id' => $id, + $this->_pkg->getTasksNs().':id' => $id, ); if ($instructions) { - $stuff[$this->_pkg->getTasksNs() . ':instructions'] = $instructions; + $stuff[$this->_pkg->getTasksNs().':instructions'] = $instructions; } - $stuff[$this->_pkg->getTasksNs() . ':name'] = $oldgroup . '::' . $param; - $stuff[$this->_pkg->getTasksNs() . ':conditiontype'] = $conditiontype; - $stuff[$this->_pkg->getTasksNs() . ':value'] = $value; + $stuff[$this->_pkg->getTasksNs().':name'] = $oldgroup.'::'.$param; + $stuff[$this->_pkg->getTasksNs().':conditiontype'] = $conditiontype; + $stuff[$this->_pkg->getTasksNs().':value'] = $value; if ($params) { - $stuff[$this->_pkg->getTasksNs() . ':param'] = $params; + $stuff[$this->_pkg->getTasksNs().':param'] = $params; } - $this->_params[$this->_pkg->getTasksNs() . ':paramgroup'][] = $stuff; + $this->_params[$this->_pkg->getTasksNs().':paramgroup'][] = $stuff; } - function getXml() + public function getXml() { return $this->_params; } /** * Use to set up a param tag for use in creating a paramgroup - * @static + * + * @param mixed $name Name of parameter + * @param mixed $prompt Prompt + * @param string $type Type, defaults to 'string' + * @param mixed $default Default value + * + * @return array */ - function getParam($name, $prompt, $type = 'string', $default = null) - { + public static function getParam( + $name, $prompt, $type = 'string', $default = null + ) { if ($default !== null) { return array( - $this->_pkg->getTasksNs() . ':name' => $name, - $this->_pkg->getTasksNs() . ':prompt' => $prompt, - $this->_pkg->getTasksNs() . ':type' => $type, - $this->_pkg->getTasksNs() . ':default' => $default + $this->_pkg->getTasksNs().':name' => $name, + $this->_pkg->getTasksNs().':prompt' => $prompt, + $this->_pkg->getTasksNs().':type' => $type, + $this->_pkg->getTasksNs().':default' => $default, ); } + return array( - $this->_pkg->getTasksNs() . ':name' => $name, - $this->_pkg->getTasksNs() . ':prompt' => $prompt, - $this->_pkg->getTasksNs() . ':type' => $type, + $this->_pkg->getTasksNs().':name' => $name, + $this->_pkg->getTasksNs().':prompt' => $prompt, + $this->_pkg->getTasksNs().':type' => $type, ); } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Replace.php b/WEB-INF/lib/pear/PEAR/Task/Replace.php index 376df64d..7483282b 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Replace.php +++ b/WEB-INF/lib/pear/PEAR/Task/Replace.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Replace.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a1 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 */ /** * Base class @@ -24,24 +23,24 @@ require_once 'PEAR/Task/Common.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ class PEAR_Task_Replace extends PEAR_Task_Common { - var $type = 'simple'; - var $phase = PEAR_TASK_PACKAGEANDINSTALL; - var $_replacements; + public $type = 'simple'; + public $phase = PEAR_TASK_PACKAGEANDINSTALL; + public $_replacements; /** * Validate the raw xml at parsing-time. - * @param PEAR_PackageFile_v2 - * @param array raw, parsed xml - * @param PEAR_Config - * @static + * + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config */ - function validateXml($pkg, $xml, $config, $fileXml) + public static function validateXml($pkg, $xml, $config, $fileXml) { if (!isset($xml['attribs'])) { return array(PEAR_TASK_ERROR_NOATTRIBS); @@ -58,33 +57,36 @@ class PEAR_Task_Replace extends PEAR_Task_Common if ($xml['attribs']['type'] == 'pear-config') { if (!in_array($xml['attribs']['to'], $config->getKeys())) { return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], - $config->getKeys()); + $config->getKeys(), ); } } elseif ($xml['attribs']['type'] == 'php-const') { if (defined($xml['attribs']['to'])) { return true; } else { return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], - array('valid PHP constant')); + array('valid PHP constant'), ); } } elseif ($xml['attribs']['type'] == 'package-info') { - if (in_array($xml['attribs']['to'], + if (in_array( + $xml['attribs']['to'], array('name', 'summary', 'channel', 'notes', 'extends', 'description', 'release_notes', 'license', 'release-license', 'license-uri', 'version', 'api-version', 'state', 'api-state', 'release_date', - 'date', 'time'))) { + 'date', 'time', ) + )) { return true; } else { return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'to', $xml['attribs']['to'], array('name', 'summary', 'channel', 'notes', 'extends', 'description', 'release_notes', 'license', 'release-license', 'license-uri', 'version', 'api-version', 'state', 'api-state', 'release_date', - 'date', 'time')); + 'date', 'time', ), ); } } else { return array(PEAR_TASK_ERROR_WRONG_ATTRIB_VALUE, 'type', $xml['attribs']['type'], - array('pear-config', 'package-info', 'php-const')); + array('pear-config', 'package-info', 'php-const'), ); } + return true; } @@ -92,8 +94,9 @@ class PEAR_Task_Replace extends PEAR_Task_Common * Initialize a task instance with the parameters * @param array raw, parsed xml * @param unused + * @param unused */ - function init($xml, $attribs) + public function init($xml, $attribs, $lastVersion = null) { $this->_replacements = isset($xml['attribs']) ? array($xml) : $xml; } @@ -102,13 +105,14 @@ class PEAR_Task_Replace extends PEAR_Task_Common * Do a package.xml 1.0 replacement, with additional package-info fields available * * See validateXml() source for the complete list of allowed fields - * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 - * @param string file contents - * @param string the eventual final file location (informational only) + * + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail - * (use $this->throwError), otherwise return the new contents + * (use $this->throwError), otherwise return the new contents */ - function startSession($pkg, $contents, $dest) + public function startSession($pkg, $contents, $dest) { $subst_from = $subst_to = array(); foreach ($this->_replacements as $a) { @@ -124,6 +128,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common $to = $chan->getServer(); } else { $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); + return false; } } else { @@ -140,6 +145,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common } if (is_null($to)) { $this->logger->log(0, "$dest: invalid pear-config replacement: $a[to]"); + return false; } } elseif ($a['type'] == 'php-const') { @@ -150,6 +156,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common $to = constant($a['to']); } else { $this->logger->log(0, "$dest: invalid php-const replacement: $a[to]"); + return false; } } else { @@ -157,6 +164,7 @@ class PEAR_Task_Replace extends PEAR_Task_Common $to = $t; } else { $this->logger->log(0, "$dest: invalid package-info replacement: $a[to]"); + return false; } } @@ -165,12 +173,14 @@ class PEAR_Task_Replace extends PEAR_Task_Common $subst_to[] = $to; } } - $this->logger->log(3, "doing " . sizeof($subst_from) . - " substitution(s) for $dest"); + $this->logger->log( + 3, "doing ".sizeof($subst_from). + " substitution(s) for $dest" + ); if (sizeof($subst_from)) { $contents = str_replace($subst_from, $subst_to, $contents); } + return $contents; } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Replace/rw.php b/WEB-INF/lib/pear/PEAR/Task/Replace/rw.php index 32dad586..ace1e9ea 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Replace/rw.php +++ b/WEB-INF/lib/pear/PEAR/Task/Replace/rw.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a10 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 */ /** * Base class @@ -24,38 +23,37 @@ require_once 'PEAR/Task/Replace.php'; * @author Greg Beaver * @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 Release 1.4.0a10 */ class PEAR_Task_Replace_rw extends PEAR_Task_Replace { - function PEAR_Task_Replace_rw(&$pkg, &$config, &$logger, $fileXml) + public function __construct(&$pkg, &$config, &$logger, $fileXml) { - parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + parent::__construct($config, $logger, PEAR_TASK_PACKAGE); $this->_contents = $fileXml; $this->_pkg = &$pkg; $this->_params = array(); } - function validate() + public function validate() { return $this->validateXml($this->_pkg, $this->_params, $this->config, $this->_contents); } - function setInfo($from, $to, $type) + public function setInfo($from, $to, $type) { $this->_params = array('attribs' => array('from' => $from, 'to' => $to, 'type' => $type)); } - function getName() + public function getName() { return 'replace'; } - function getXml() + public function getXml() { return $this->_params; } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Unixeol.php b/WEB-INF/lib/pear/PEAR/Task/Unixeol.php index 89ca81be..6ef7174b 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Unixeol.php +++ b/WEB-INF/lib/pear/PEAR/Task/Unixeol.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Unixeol.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a1 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 */ /** * Base class @@ -24,28 +23,29 @@ require_once 'PEAR/Task/Common.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ class PEAR_Task_Unixeol extends PEAR_Task_Common { - var $type = 'simple'; - var $phase = PEAR_TASK_PACKAGE; - var $_replacements; + public $type = 'simple'; + public $phase = PEAR_TASK_PACKAGE; + public $_replacements; /** * Validate the raw xml at parsing-time. - * @param PEAR_PackageFile_v2 - * @param array raw, parsed xml - * @param PEAR_Config - * @static + * + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config */ - function validateXml($pkg, $xml, $config, $fileXml) + public static function validateXml($pkg, $xml, $config, $fileXml) { if ($xml != '') { return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); } + return true; } @@ -53,8 +53,9 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common * Initialize a task instance with the parameters * @param array raw, parsed xml * @param unused + * @param unused */ - function init($xml, $attribs) + public function init($xml, $attribs, $lastVersion = null) { } @@ -62,16 +63,17 @@ class PEAR_Task_Unixeol extends PEAR_Task_Common * Replace all line endings with line endings customized for the current OS * * See validateXml() source for the complete list of allowed fields - * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 - * @param string file contents - * @param string the eventual final file location (informational only) + * + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail - * (use $this->throwError), otherwise return the new contents + * (use $this->throwError), otherwise return the new contents */ - function startSession($pkg, $contents, $dest) + public function startSession($pkg, $contents, $dest) { $this->logger->log(3, "replacing all line endings with \\n in $dest"); + return preg_replace("/\r\n|\n\r|\r|\n/", "\n", $contents); } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Unixeol/rw.php b/WEB-INF/lib/pear/PEAR/Task/Unixeol/rw.php index b2ae5fa5..9134e2c9 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Unixeol/rw.php +++ b/WEB-INF/lib/pear/PEAR/Task/Unixeol/rw.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a10 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 */ /** * Base class @@ -24,33 +23,33 @@ require_once 'PEAR/Task/Unixeol.php'; * @author Greg Beaver * @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 Release 1.4.0a10 */ class PEAR_Task_Unixeol_rw extends PEAR_Task_Unixeol { - function PEAR_Task_Unixeol_rw(&$pkg, &$config, &$logger, $fileXml) + function __construct(&$pkg, &$config, &$logger, $fileXml) { - parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + parent::__construct($config, $logger, PEAR_TASK_PACKAGE); $this->_contents = $fileXml; $this->_pkg = &$pkg; $this->_params = array(); } - function validate() + public function validate() { return true; } - function getName() + public function getName() { return 'unixeol'; } - function getXml() + public function getXml() { return ''; } } -?> \ No newline at end of file +?> diff --git a/WEB-INF/lib/pear/PEAR/Task/Windowseol.php b/WEB-INF/lib/pear/PEAR/Task/Windowseol.php index 8ba41711..620c940f 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Windowseol.php +++ b/WEB-INF/lib/pear/PEAR/Task/Windowseol.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Windowseol.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a1 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a1 */ /** * Base class @@ -19,33 +18,35 @@ require_once 'PEAR/Task/Common.php'; /** * Implements the windows line endsings file task. - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.4 - * @link http://pear.php.net/package/PEAR - * @since Class available since Release 1.4.0a1 + * + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.10.1 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a1 */ class PEAR_Task_Windowseol extends PEAR_Task_Common { - var $type = 'simple'; - var $phase = PEAR_TASK_PACKAGE; - var $_replacements; + public $type = 'simple'; + public $phase = PEAR_TASK_PACKAGE; + public $_replacements; /** * Validate the raw xml at parsing-time. - * @param PEAR_PackageFile_v2 - * @param array raw, parsed xml - * @param PEAR_Config - * @static + * + * @param PEAR_PackageFile_v2 + * @param array raw, parsed xml + * @param PEAR_Config */ - function validateXml($pkg, $xml, $config, $fileXml) + public static function validateXml($pkg, $xml, $config, $fileXml) { if ($xml != '') { return array(PEAR_TASK_ERROR_INVALID, 'no attributes allowed'); } + return true; } @@ -53,8 +54,9 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common * Initialize a task instance with the parameters * @param array raw, parsed xml * @param unused + * @param unused */ - function init($xml, $attribs) + public function init($xml, $attribs, $lastVersion = null) { } @@ -62,16 +64,17 @@ class PEAR_Task_Windowseol extends PEAR_Task_Common * Replace all line endings with windows line endings * * See validateXml() source for the complete list of allowed fields - * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 - * @param string file contents - * @param string the eventual final file location (informational only) + * + * @param PEAR_PackageFile_v1|PEAR_PackageFile_v2 + * @param string file contents + * @param string the eventual final file location (informational only) * @return string|false|PEAR_Error false to skip this file, PEAR_Error to fail - * (use $this->throwError), otherwise return the new contents + * (use $this->throwError), otherwise return the new contents */ - function startSession($pkg, $contents, $dest) + public function startSession($pkg, $contents, $dest) { $this->logger->log(3, "replacing all line endings with \\r\\n in $dest"); + return preg_replace("/\r\n|\n\r|\r|\n/", "\r\n", $contents); } } -?> \ No newline at end of file diff --git a/WEB-INF/lib/pear/PEAR/Task/Windowseol/rw.php b/WEB-INF/lib/pear/PEAR/Task/Windowseol/rw.php index f0f1149c..e3cf0052 100644 --- a/WEB-INF/lib/pear/PEAR/Task/Windowseol/rw.php +++ b/WEB-INF/lib/pear/PEAR/Task/Windowseol/rw.php @@ -4,14 +4,13 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: rw.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR - * @since File available since Release 1.4.0a10 + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR + * @since File available since Release 1.4.0a10 */ /** * Base class @@ -19,38 +18,39 @@ require_once 'PEAR/Task/Windowseol.php'; /** * Abstracts the windowseol task xml. - * @category pear - * @package PEAR - * @author Greg Beaver - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 1.9.4 - * @link http://pear.php.net/package/PEAR - * @since Class available since Release 1.4.0a10 + * + * @category pear + * @package PEAR + * @author Greg Beaver + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 1.10.1 + * @link http://pear.php.net/package/PEAR + * @since Class available since Release 1.4.0a10 */ class PEAR_Task_Windowseol_rw extends PEAR_Task_Windowseol { - function PEAR_Task_Windowseol_rw(&$pkg, &$config, &$logger, $fileXml) + function __construct(&$pkg, &$config, &$logger, $fileXml) { - parent::PEAR_Task_Common($config, $logger, PEAR_TASK_PACKAGE); + parent::__construct($config, $logger, PEAR_TASK_PACKAGE); $this->_contents = $fileXml; $this->_pkg = &$pkg; $this->_params = array(); } - function validate() + public function validate() { return true; } - function getName() + public function getName() { return 'windowseol'; } - function getXml() + public function getXml() { return ''; } } -?> \ No newline at end of file +?> diff --git a/WEB-INF/lib/pear/PEAR/Validate.php b/WEB-INF/lib/pear/PEAR/Validate.php index 176560bc..8e29b7cd 100644 --- a/WEB-INF/lib/pear/PEAR/Validate.php +++ b/WEB-INF/lib/pear/PEAR/Validate.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Validate.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -32,7 +31,7 @@ require_once 'PEAR/Validator/PECL.php'; * @author Greg Beaver * @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 Release 1.4.0a1 */ @@ -85,9 +84,8 @@ class PEAR_Validate * to the PEAR naming convention, so the method is final and static. * @param string * @final - * @static */ - function validGroupName($name) + public static function validGroupName($name) { return (bool) preg_match('/^' . _PEAR_COMMON_PACKAGE_NAME_PREG . '\\z/', $name); } @@ -96,10 +94,9 @@ class PEAR_Validate * Determine whether $state represents a valid stability level * @param string * @return bool - * @static * @final */ - function validState($state) + public static function validState($state) { return in_array($state, array('snapshot', 'devel', 'alpha', 'beta', 'stable')); } @@ -107,10 +104,9 @@ class PEAR_Validate /** * Get a list of valid stability levels * @return array - * @static * @final */ - function getValidStates() + public static function getValidStates() { return array('snapshot', 'devel', 'alpha', 'beta', 'stable'); } @@ -120,10 +116,9 @@ class PEAR_Validate * by version_compare * @param string * @return bool - * @static * @final */ - function validVersion($ver) + public static function validVersion($ver) { return (bool) preg_match(PEAR_COMMON_PACKAGE_VERSION_PREG, $ver); } @@ -207,7 +202,8 @@ class PEAR_Validate $this->_packagexml->getExtends()) { $version = $this->_packagexml->getVersion() . ''; $name = $this->_packagexml->getPackage(); - $test = array_shift($a = explode('.', $version)); + $a = explode('.', $version); + $test = array_shift($a); if ($test == '0') { return true; } diff --git a/WEB-INF/lib/pear/PEAR/Validator/PECL.php b/WEB-INF/lib/pear/PEAR/Validator/PECL.php index 89b951f7..830c8e9b 100644 --- a/WEB-INF/lib/pear/PEAR/Validator/PECL.php +++ b/WEB-INF/lib/pear/PEAR/Validator/PECL.php @@ -9,7 +9,6 @@ * @author Greg Beaver * @copyright 1997-2006 The PHP Group * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: PECL.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a5 */ @@ -24,7 +23,7 @@ require_once 'PEAR/Validate.php'; * @author Greg Beaver * @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 Release 1.4.0a5 */ diff --git a/WEB-INF/lib/pear/PEAR/XMLParser.php b/WEB-INF/lib/pear/PEAR/XMLParser.php index 7f091c16..619743bc 100644 --- a/WEB-INF/lib/pear/PEAR/XMLParser.php +++ b/WEB-INF/lib/pear/PEAR/XMLParser.php @@ -10,7 +10,6 @@ * @author Stephan Schmidt (original XML_Unserializer code) * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license New BSD License - * @version CVS: $Id: XMLParser.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.0a1 */ @@ -23,7 +22,7 @@ * @author Stephan Schmidt (original XML_Unserializer code) * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license New BSD License - * @version Release: 1.9.4 + * @version Release: 1.10.1 * @link http://pear.php.net/package/PEAR * @since Class available since Release 1.4.0a1 */ @@ -95,11 +94,6 @@ class PEAR_XMLParser $this->encoding = 'UTF-8'; } - if (version_compare(phpversion(), '5.0.0', 'lt') && $this->encoding == 'UTF-8') { - $data = utf8_decode($data); - $this->encoding = 'ISO-8859-1'; - } - $xp = xml_parser_create($this->encoding); xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, 0); xml_set_object($xp, $this); diff --git a/WEB-INF/lib/pear/PEAR5.php b/WEB-INF/lib/pear/PEAR5.php deleted file mode 100644 index 42860678..00000000 --- a/WEB-INF/lib/pear/PEAR5.php +++ /dev/null @@ -1,33 +0,0 @@ - * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: System.php 313024 2011-07-06 19:51:24Z dufuz $ * @link http://pear.php.net/package/PEAR * @since File available since Release 0.1 */ @@ -51,7 +50,7 @@ $GLOBALS['_System_temp_files'] = array(); * @author Tomas V.V. Cox * @copyright 1997-2006 The PHP Group * @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 Release 0.1 * @static @@ -65,12 +64,27 @@ class System * @param string $short_options the allowed option short-tags * @param string $long_options the allowed option long-tags * @return array the given options and there values - * @static - * @access private */ - function _parseArgs($argv, $short_options, $long_options = null) + public static function _parseArgs($argv, $short_options, $long_options = null) { if (!is_array($argv) && $argv !== null) { + /* + // Quote all items that are a short option + $av = preg_split('/(\A| )--?[a-z0-9]+[ =]?((?getMessage(); @@ -124,10 +137,8 @@ class System * @param integer $aktinst starting deep of the lookup * @param bool $silent if true, do not emit errors. * @return array the structure of the dir - * @static - * @access private */ - function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) + protected static function _dirToStruct($sPath, $maxinst, $aktinst = 0, $silent = false) { $struct = array('dirs' => array(), 'files' => array()); if (($dir = @opendir($sPath)) === false) { @@ -170,7 +181,7 @@ class System * @static * @see System::_dirToStruct() */ - function _multipleToStruct($files) + protected static function _multipleToStruct($files) { $struct = array('dirs' => array(), 'files' => array()); settype($files, 'array'); @@ -196,7 +207,7 @@ class System * @static * @access public */ - function rm($args) + public static function rm($args) { $opts = System::_parseArgs($args, 'rf'); // "f" does nothing but I like it :-) if (PEAR::isError($opts)) { @@ -239,10 +250,8 @@ class System * The -p option will create parent directories * @param string $args the name of the director(y|ies) to create * @return bool True for success - * @static - * @access public */ - function mkDir($args) + public static function mkDir($args) { $opts = System::_parseArgs($args, 'pm:'); if (PEAR::isError($opts)) { @@ -310,10 +319,8 @@ class System * * @param string $args the arguments * @return boolean true on success - * @static - * @access public */ - function &cat($args) + public static function &cat($args) { $ret = null; $files = array(); @@ -384,10 +391,8 @@ class System * @param string $args The arguments * @return mixed the full path of the created (file|dir) or false * @see System::tmpdir() - * @static - * @access public */ - function mktemp($args = null) + public static function mktemp($args = null) { static $first_time = true; $opts = System::_parseArgs($args, 't:d'); @@ -436,11 +441,8 @@ class System /** * Remove temporary files created my mkTemp. This function is executed * at script shutdown time - * - * @static - * @access private */ - function _removeTmpFiles() + public static function _removeTmpFiles() { if (count($GLOBALS['_System_temp_files'])) { $delete = $GLOBALS['_System_temp_files']; @@ -456,10 +458,9 @@ class System * Note: php.ini-recommended removes the "E" from the variables_order setting, * making unavaible the $_ENV array, that s why we do tests with _ENV * - * @static * @return string The temporary directory on the system */ - function tmpdir() + public static function tmpdir() { if (OS_WINDOWS) { if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { @@ -489,10 +490,9 @@ class System * @param mixed $fallback Value to return if $program is not found * * @return mixed A string with the full path or false if not found - * @static * @author Stig Bakken */ - function which($program, $fallback = false) + public static function which($program, $fallback = false) { // enforce API if (!is_string($program) || '' == $program) { @@ -504,13 +504,11 @@ class System $path_elements[] = dirname($program); $program = basename($program); } else { - // Honor safe mode - if (!ini_get('safe_mode') || !$path = ini_get('safe_mode_exec_dir')) { - $path = getenv('PATH'); - if (!$path) { - $path = getenv('Path'); // some OSes are just stupid enough to do this - } + $path = getenv('PATH'); + if (!$path) { + $path = getenv('Path'); // some OSes are just stupid enough to do this } + $path_elements = explode(PATH_SEPARATOR, $path); } @@ -522,17 +520,14 @@ class System if (strpos($program, '.') !== false) { array_unshift($exe_suffixes, ''); } - // is_executable() is not available on windows for PHP4 - $pear_is_executable = (function_exists('is_executable')) ? 'is_executable' : 'is_file'; } else { $exe_suffixes = array(''); - $pear_is_executable = 'is_executable'; } foreach ($exe_suffixes as $suff) { foreach ($path_elements as $dir) { $file = $dir . DIRECTORY_SEPARATOR . $program . $suff; - if (@$pear_is_executable($file)) { + if (is_executable($file)) { return $file; } } @@ -561,10 +556,8 @@ class System * * @param mixed Either array or string with the command line * @return array Array of found files - * @static - * */ - function find($args) + public static function find($args) { if (!is_array($args)) { $args = preg_split('/\s+/', $args, -1, PREG_SPLIT_NO_EMPTY); diff --git a/WEB-INF/lib/pear/scripts/pear.bat b/WEB-INF/lib/pear/scripts/pear.bat index d7675bbf..7f583760 100644 --- a/WEB-INF/lib/pear/scripts/pear.bat +++ b/WEB-INF/lib/pear/scripts/pear.bat @@ -1,111 +1,111 @@ -@ECHO OFF - -REM ---------------------------------------------------------------------- -REM PHP version 5 -REM ---------------------------------------------------------------------- -REM Copyright (c) 1997-2010 The Authors -REM ---------------------------------------------------------------------- -REM http://opensource.org/licenses/bsd-license.php New BSD License -REM ---------------------------------------------------------------------- -REM Authors: Alexander Merz (alexmerz@php.net) -REM ---------------------------------------------------------------------- -REM -REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary) - -REM change this lines to match the paths of your system -REM ------------------- - - -REM Test to see if this is a raw pear.bat (uninstalled version) -SET TMPTMPTMPTMPT=@includ -SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ -FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) - -REM 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@" - -GOTO :INSTALLED - -:NOTINSTALLED -ECHO WARNING: This is a raw, uninstalled pear.bat - -REM Check to see if we can grab the directory of this file (Windows NT+) -IF %~n0 == pear ( -FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( -SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" -echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" -"%PHP_PEAR_PHP_BIN%" -v -GOTO :NEXTTEST -)) -GOTO :FAILAUTODETECT -:NEXTTEST -IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( - -REM We can use this PHP to run a temporary php file to get the dirname of pear - -echo ^ > ~~getloc.php -"%PHP_PEAR_PHP_BIN%" ~~getloc.php -set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a -DEL ~a.a -DEL ~~getloc.php -set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" - -REM Make sure there is a pearcmd.php at our disposal - -IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( -IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -) -) -GOTO :INSTALLED -) ELSE ( -REM Windows Me/98 cannot succeed, so allow the batch to fail -) -:FAILAUTODETECT -echo WARNING: failed to auto-detect pear information -:INSTALLED - -REM 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 - -REM 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 date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -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 OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2010 The Authors +REM ---------------------------------------------------------------------- +REM http://opensource.org/licenses/bsd-license.php New BSD License +REM ---------------------------------------------------------------------- +REM Authors: Alexander Merz (alexmerz@php.net) +REM ---------------------------------------------------------------------- +REM +REM Last updated 12/29/2004 ($Id$ is not replaced if the file is binary) + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM 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@" + +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^ > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM 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 + +REM 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 date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d open_basedir="" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d register_argc_argv="On" -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 \ No newline at end of file diff --git a/WEB-INF/lib/pear/scripts/pearcmd.php b/WEB-INF/lib/pear/scripts/pearcmd.php index a3a928a3..efc8a8db 100644 --- a/WEB-INF/lib/pear/scripts/pearcmd.php +++ b/WEB-INF/lib/pear/scripts/pearcmd.php @@ -6,17 +6,16 @@ * * PHP versions 4 and 5 * - * @category pear - * @package PEAR - * @author Stig Bakken - * @author Tomas V.V.Cox - * @copyright 1997-2009 The Authors - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: pearcmd.php 313023 2011-07-06 19:17:11Z dufuz $ - * @link http://pear.php.net/package/PEAR + * @category pear + * @package PEAR + * @author Stig Bakken + * @author Tomas V.V.Cox + * @copyright 1997-2009 The Authors + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @link http://pear.php.net/package/PEAR */ -ob_end_clean(); +@ob_end_clean(); if (!defined('PEAR_RUNTYPE')) { // this is defined in peclcmd.php as 'pecl' define('PEAR_RUNTYPE', 'pear'); @@ -25,21 +24,20 @@ define('PEAR_IGNORE_BACKTRACE', 1); /** * @nodep Gtk */ -if ('@include_path@' != '@'.'include_path'.'@') { - ini_set('include_path', '@include_path@'); +//the space is needed for windows include paths with trailing backslash +// http://pear.php.net/bugs/bug.php?id=19482 +if ('@include_path@ ' != '@'.'include_path'.'@ ') { + ini_set('include_path', trim('@include_path@ '). PATH_SEPARATOR . get_include_path()); $raw = false; } else { // this is a raw, uninstalled pear, either a cvs checkout, or php distro $raw = true; } @ini_set('allow_url_fopen', true); -if (!ini_get('safe_mode')) { - @set_time_limit(0); -} +@set_time_limit(0); ob_implicit_flush(true); @ini_set('track_errors', true); @ini_set('html_errors', false); -@ini_set('magic_quotes_runtime', false); $_PEAR_PHPDIR = '#$%^&*'; set_error_handler('error_handler'); @@ -57,7 +55,8 @@ $all_commands = PEAR_Command::getCommands(); // remove this next part when we stop supporting that crap-ass PHP 4.2 if (!isset($_SERVER['argv']) && !isset($argv) && !isset($HTTP_SERVER_VARS['argv'])) { - echo 'ERROR: either use the CLI php executable, or set register_argc_argv=On in php.ini'; + echo 'ERROR: either use the CLI php executable, ' . + 'or set register_argc_argv=On in php.ini'; exit(1); } @@ -78,18 +77,14 @@ $opts = $options[0]; $fetype = 'CLI'; if ($progname == 'gpear' || $progname == 'pear-gtk') { - $fetype = 'Gtk'; + $fetype = 'Gtk2'; } else { foreach ($opts as $opt) { if ($opt[0] == 'G') { - $fetype = 'Gtk'; + $fetype = 'Gtk2'; } } } -//Check if Gtk and PHP >= 5.1.0 -if ($fetype == 'Gtk' && version_compare(phpversion(), '5.1.0', '>=')) { - $fetype = 'Gtk2'; -} $pear_user_config = ''; $pear_system_config = ''; @@ -99,12 +94,12 @@ $verbose = 1; foreach ($opts as $opt) { switch ($opt[0]) { - case 'c': - $pear_user_config = $opt[1]; - break; - case 'C': - $pear_system_config = $opt[1]; - break; + case 'c': + $pear_user_config = $opt[1]; + break; + case 'C': + $pear_system_config = $opt[1]; + break; } } @@ -115,10 +110,10 @@ $config = &PEAR_Config::singleton($pear_user_config, $pear_system_config); if (PEAR::isError($config)) { $_file = ''; if ($pear_user_config !== false) { - $_file .= $pear_user_config; + $_file .= $pear_user_config; } if ($pear_system_config !== false) { - $_file .= '/' . $pear_system_config; + $_file .= '/' . $pear_system_config; } if ($_file == '/') { $_file = 'The default config file'; @@ -133,11 +128,6 @@ if (PEAR::isError($config)) { $_PEAR_PHPDIR = $config->get('php_dir'); $ui->setConfig($config); PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); -if (ini_get('safe_mode')) { - $ui->outputData('WARNING: running in safe mode requires that all files created ' . - 'be the same uid as the current script. PHP reports this script is uid: ' . - @getmyuid() . ', and current user is: ' . @get_current_user()); -} $verbose = $config->get("verbose"); $cmdopts = array(); @@ -147,17 +137,20 @@ if ($raw) { $found = false; foreach ($opts as $opt) { if ($opt[0] == 'd' || $opt[0] == 'D') { - $found = true; // the user knows what they are doing, and are setting config values + // the user knows what they are doing, and are setting config values + $found = true; } } if (!$found) { // no prior runs, try to install PEAR - if (strpos(dirname(__FILE__), 'scripts')) { - $packagexml = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'package2.xml'; - $pearbase = dirname(dirname(__FILE__)); + $parent = dirname(__FILE__); + if (strpos($parent, 'scripts')) { + $grandparent = dirname($parent); + $packagexml = $grandparent . DIRECTORY_SEPARATOR . 'package2.xml'; + $pearbase = $grandparent; } else { - $packagexml = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package2.xml'; - $pearbase = dirname(__FILE__); + $packagexml = $parent . DIRECTORY_SEPARATOR . 'package2.xml'; + $pearbase = $parent; } if (file_exists($packagexml)) { $options[1] = array( @@ -168,7 +161,10 @@ if ($raw) { $config->set('data_dir', $pearbase . DIRECTORY_SEPARATOR . 'data'); $config->set('doc_dir', $pearbase . DIRECTORY_SEPARATOR . 'docs'); $config->set('test_dir', $pearbase . DIRECTORY_SEPARATOR . 'tests'); - $config->set('ext_dir', $pearbase . DIRECTORY_SEPARATOR . 'extensions'); + $config->set( + 'ext_dir', + $pearbase . DIRECTORY_SEPARATOR . 'extensions' + ); $config->set('bin_dir', $pearbase); $config->mergeConfigFile($pearbase . 'pear.ini', false); $config->store(); @@ -180,56 +176,64 @@ if ($raw) { foreach ($opts as $opt) { $param = !empty($opt[1]) ? $opt[1] : true; switch ($opt[0]) { - case 'd': - if ($param === true) { - die('Invalid usage of "-d" option, expected -d config_value=value, ' . - 'received "-d"' . "\n"); - } - $possible = explode('=', $param); - if (count($possible) != 2) { - die('Invalid usage of "-d" option, expected -d config_value=value, received "' . - $param . '"' . "\n"); - } - list($key, $value) = explode('=', $param); - $config->set($key, $value, 'user'); - break; - case 'D': - if ($param === true) { - die('Invalid usage of "-d" option, expected -d config_value=value, ' . - 'received "-d"' . "\n"); - } - $possible = explode('=', $param); - if (count($possible) != 2) { - die('Invalid usage of "-d" option, expected -d config_value=value, received "' . - $param . '"' . "\n"); - } - list($key, $value) = explode('=', $param); - $config->set($key, $value, 'system'); - break; - case 's': - $store_user_config = true; - break; - case 'S': - $store_system_config = true; - break; - case 'u': - $config->remove($param, 'user'); - break; - case 'v': - $config->set('verbose', $config->get('verbose') + 1); - break; - case 'q': - $config->set('verbose', $config->get('verbose') - 1); - break; - case 'V': - usage(null, 'version'); - case 'c': - case 'C': - break; - default: - // all non pear params goes to the command - $cmdopts[$opt[0]] = $param; - break; + case 'd': + if ($param === true) { + die( + 'Invalid usage of "-d" option, expected -d config_value=value, ' . + 'received "-d"' . "\n" + ); + } + $possible = explode('=', $param); + if (count($possible) != 2) { + die( + 'Invalid usage of "-d" option, expected ' . + '-d config_value=value, received "' . $param . '"' . "\n" + ); + } + list($key, $value) = explode('=', $param); + $config->set($key, $value, 'user'); + break; + case 'D': + if ($param === true) { + die( + 'Invalid usage of "-d" option, expected ' . + '-d config_value=value, received "-d"' . "\n" + ); + } + $possible = explode('=', $param); + if (count($possible) != 2) { + die( + 'Invalid usage of "-d" option, expected ' . + '-d config_value=value, received "' . $param . '"' . "\n" + ); + } + list($key, $value) = explode('=', $param); + $config->set($key, $value, 'system'); + break; + case 's': + $store_user_config = true; + break; + case 'S': + $store_system_config = true; + break; + case 'u': + $config->remove($param, 'user'); + break; + case 'v': + $config->set('verbose', $config->get('verbose') + 1); + break; + case 'q': + $config->set('verbose', $config->get('verbose') - 1); + break; + case 'V': + usage(null, 'version'); + case 'c': + case 'C': + break; + default: + // all non pear params goes to the command + $cmdopts[$opt[0]] = $param; + break; } } @@ -246,75 +250,93 @@ if (empty($command) && ($store_user_config || $store_system_config)) { exit; } -if ($fetype == 'Gtk' || $fetype == 'Gtk2') { +if ($fetype == 'Gtk2') { if (!$config->validConfiguration()) { - PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . - "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . - 'file to one of these locations, or use the -c and -s options to create one'); + PEAR::raiseError( + "CRITICAL ERROR: no existing valid configuration files found in " . + "files '$pear_user_config' or '$pear_system_config', " . + "please copy an existing configuration file to one of these " . + "locations, or use the -c and -s options to create one" + ); } Gtk::main(); -} else do { - if ($command == 'help') { - usage(null, @$options[1][1]); - } - - if (!$config->validConfiguration()) { - PEAR::raiseError('CRITICAL ERROR: no existing valid configuration files found in files ' . - "'$pear_user_config' or '$pear_system_config', please copy an existing configuration" . - 'file to one of these locations, or use the -c and -s options to create one'); - } +} else { + do { + if ($command == 'help') { + usage(null, isset($options[1][1]) ? $options[1][1] : null); + } - PEAR::pushErrorHandling(PEAR_ERROR_RETURN); - $cmd = PEAR_Command::factory($command, $config); - PEAR::popErrorHandling(); - if (PEAR::isError($cmd)) { - usage(null, @$options[1][0]); - } + if (!$config->validConfiguration()) { + PEAR::raiseError( + "CRITICAL ERROR: no existing valid configuration files found " . + "in files '$pear_user_config' or '$pear_system_config', " . + "please copy an existing configuration file to one of " . + "these locations, or use the -c and -s options to create one" + ); + } - $short_args = $long_args = null; - PEAR_Command::getGetoptArgs($command, $short_args, $long_args); - array_shift($options[1]); - $tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args); + PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + $cmd = PEAR_Command::factory($command, $config); + PEAR::popErrorHandling(); + if (PEAR::isError($cmd)) { + usage(null, isset($options[1][0]) ? $options[1][0] : null); + } - if (PEAR::isError($tmp)) { - break; - } + $short_args = $long_args = null; + PEAR_Command::getGetoptArgs($command, $short_args, $long_args); + array_shift($options[1]); + $tmp = Console_Getopt::getopt2($options[1], $short_args, $long_args); - list($tmpopt, $params) = $tmp; - $opts = array(); - foreach ($tmpopt as $foo => $tmp2) { - list($opt, $value) = $tmp2; - if ($value === null) { - $value = true; // options without args + if (PEAR::isError($tmp)) { + break; } - if (strlen($opt) == 1) { - $cmdoptions = $cmd->getOptions($command); - foreach ($cmdoptions as $o => $d) { - if (isset($d['shortopt']) && $d['shortopt'] == $opt) { - $opts[$o] = $value; - } + list($tmpopt, $params) = $tmp; + $opts = array(); + foreach ($tmpopt as $foo => $tmp2) { + list($opt, $value) = $tmp2; + if ($value === null) { + $value = true; // options without args } - } else { - if (substr($opt, 0, 2) == '--') { - $opts[substr($opt, 2)] = $value; + + if (strlen($opt) == 1) { + $cmdoptions = $cmd->getOptions($command); + foreach ($cmdoptions as $o => $d) { + if (isset($d['shortopt']) && $d['shortopt'] == $opt) { + $opts[$o] = $value; + } + } + } else { + if (substr($opt, 0, 2) == '--') { + $opts[substr($opt, 2)] = $value; + } } } - } - $ok = $cmd->run($command, $opts, $params); - if ($ok === false) { - PEAR::raiseError("unknown command `$command'"); - } + $ok = $cmd->run($command, $opts, $params); + if ($ok === false) { + PEAR::raiseError("unknown command `$command'"); + } - if (PEAR::isError($ok)) { - PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, array($ui, "displayFatalError")); - PEAR::raiseError($ok); - } -} while (false); + if (PEAR::isError($ok)) { + PEAR::setErrorHandling( + PEAR_ERROR_CALLBACK, array($ui, "displayFatalError") + ); + PEAR::raiseError($ok); + } + } while (false); +} // {{{ usage() +/** + * Display usage information + * + * @param mixed $error Optional error message + * @param mixed $helpsubject Optional subject/command to display help for + * + * @return void + */ function usage($error = null, $helpsubject = null) { global $progname, $all_commands; @@ -339,7 +361,10 @@ function usage($error = null, $helpsubject = null) "Usage: $progname [options] command [command-options] \n". "Type \"$progname help options\" to list all options.\n". "Type \"$progname help shortcuts\" to list all command shortcuts.\n". - "Type \"$progname help \" to get the help for the specified command."; + "Type \"$progname help version\" or ". + "\"$progname version\" to list version information.\n". + "Type \"$progname help \" to get the help ". + "for the specified command."; } fputs($stdout, "$put\n"); fclose($stdout); @@ -350,6 +375,13 @@ function usage($error = null, $helpsubject = null) exit(1); } +/** + * Return help string for specified command + * + * @param string $command Command to return help for + * + * @return void + */ function cmdHelp($command) { global $progname, $all_commands, $config; @@ -399,23 +431,40 @@ function cmdHelp($command) // }}} -function error_handler($errno, $errmsg, $file, $line, $vars) { - if ((defined('E_STRICT') && $errno & E_STRICT) || (defined('E_DEPRECATED') && - $errno & E_DEPRECATED) || !error_reporting()) { - if (defined('E_STRICT') && $errno & E_STRICT) { +/** + * error_handler + * + * @param mixed $errno Error number + * @param mixed $errmsg Message + * @param mixed $file Filename + * @param mixed $line Line number + * @param mixed $vars Variables + * + * @access public + * @return boolean + */ +function error_handler($errno, $errmsg, $file, $line, $vars) +{ + if ($errno & E_STRICT + || $errno & E_DEPRECATED + || !error_reporting() + ) { + if ($errno & E_STRICT) { return; // E_STRICT } - if (defined('E_DEPRECATED') && $errno & E_DEPRECATED) { + if ($errno & E_DEPRECATED) { return; // E_DEPRECATED } - if ($GLOBALS['config']->get('verbose') < 4) { + if (!error_reporting() && isset($GLOBALS['config']) && $GLOBALS['config']->get('verbose') < 4) { return false; // @silenced error, show all if debug is high enough } } $errortype = array ( + E_DEPRECATED => 'Deprecated Warning', E_ERROR => "Error", E_WARNING => "Warning", E_PARSE => "Parsing Error", + E_STRICT => 'Strict Warning', E_NOTICE => "Notice", E_CORE_ERROR => "Core Error", E_CORE_WARNING => "Core Warning", @@ -445,4 +494,4 @@ function error_handler($errno, $errmsg, $file, $line, $vars) { * mode: php * End: */ -// vim600:syn=php \ No newline at end of file +// vim600:syn=php diff --git a/WEB-INF/lib/pear/scripts/peardev.bat b/WEB-INF/lib/pear/scripts/peardev.bat index 8b67c7d9..48e03872 100644 --- a/WEB-INF/lib/pear/scripts/peardev.bat +++ b/WEB-INF/lib/pear/scripts/peardev.bat @@ -1,115 +1,115 @@ -@ECHO OFF - -REM ---------------------------------------------------------------------- -REM PHP version 5 -REM ---------------------------------------------------------------------- -REM Copyright (c) 1997-2004 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: peardev.bat,v 1.6 2007-09-03 03:00:17 cellog Exp $ - -REM change this lines to match the paths of your system -REM ------------------- - - -REM Test to see if this is a raw pear.bat (uninstalled version) -SET TMPTMPTMPTMPT=@includ -SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ -FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) - -REM 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@" -GOTO :INSTALLED - -:NOTINSTALLED -ECHO WARNING: This is a raw, uninstalled pear.bat - -REM Check to see if we can grab the directory of this file (Windows NT+) -IF %~n0 == pear ( -FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( -SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" -echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" -"%PHP_PEAR_PHP_BIN%" -v -GOTO :NEXTTEST -)) -GOTO :FAILAUTODETECT -:NEXTTEST -IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( - -REM We can use this PHP to run a temporary php file to get the dirname of pear - -echo ^ > ~~getloc.php -"%PHP_PEAR_PHP_BIN%" ~~getloc.php -set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a -DEL ~a.a -DEL ~~getloc.php -set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" - -REM Make sure there is a pearcmd.php at our disposal - -IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( -IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -) -) -GOTO :INSTALLED -) ELSE ( -REM Windows Me/98 cannot succeed, so allow the batch to fail -) -:FAILAUTODETECT -echo WARNING: failed to auto-detect pear information -:INSTALLED - -REM 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 -REM 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 date.timezone=UTC -d memory_limit="-1" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d open_basedir="" -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 OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2004 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: peardev.bat,v 1.6 2007-09-03 03:00:17 cellog Exp $ + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM 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@" +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^ > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM 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 +REM 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 date.timezone=UTC -d memory_limit="-1" -d safe_mode=0 -d register_argc_argv="On" -d auto_prepend_file="" -d auto_append_file="" -d variables_order=EGPCS -d open_basedir="" -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 \ No newline at end of file diff --git a/WEB-INF/lib/pear/scripts/pecl.bat b/WEB-INF/lib/pear/scripts/pecl.bat index e7c823bc..f604284d 100644 --- a/WEB-INF/lib/pear/scripts/pecl.bat +++ b/WEB-INF/lib/pear/scripts/pecl.bat @@ -1,115 +1,115 @@ -@ECHO OFF - -REM ---------------------------------------------------------------------- -REM PHP version 5 -REM ---------------------------------------------------------------------- -REM Copyright (c) 1997-2004 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 Last updated 02/08/2004 ($Id$ is not replaced if the file is binary) - -REM change this lines to match the paths of your system -REM ------------------- - - -REM Test to see if this is a raw pear.bat (uninstalled version) -SET TMPTMPTMPTMPT=@includ -SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ -FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) - -REM 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@" -GOTO :INSTALLED - -:NOTINSTALLED -ECHO WARNING: This is a raw, uninstalled pear.bat - -REM Check to see if we can grab the directory of this file (Windows NT+) -IF %~n0 == pear ( -FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( -SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" -echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" -"%PHP_PEAR_PHP_BIN%" -v -GOTO :NEXTTEST -)) -GOTO :FAILAUTODETECT -:NEXTTEST -IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( - -REM We can use this PHP to run a temporary php file to get the dirname of pear - -echo ^ > ~~getloc.php -"%PHP_PEAR_PHP_BIN%" ~~getloc.php -set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a -DEL ~a.a -DEL ~~getloc.php -set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" - -REM Make sure there is a pearcmd.php at our disposal - -IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( -IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php -) -) -GOTO :INSTALLED -) ELSE ( -REM Windows Me/98 cannot succeed, so allow the batch to fail -) -:FAILAUTODETECT -echo WARNING: failed to auto-detect pear information -:INSTALLED - -REM 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 -REM 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 -n -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -d register_argc_argv="On" -d variables_order=EGPCS -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 -:END +@ECHO OFF + +REM ---------------------------------------------------------------------- +REM PHP version 5 +REM ---------------------------------------------------------------------- +REM Copyright (c) 1997-2004 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 Last updated 02/08/2004 ($Id$ is not replaced if the file is binary) + +REM change this lines to match the paths of your system +REM ------------------- + + +REM Test to see if this is a raw pear.bat (uninstalled version) +SET TMPTMPTMPTMPT=@includ +SET PMTPMTPMT=%TMPTMPTMPTMPT%e_path@ +FOR %%x IN ("@include_path@") DO (if %%x=="%PMTPMTPMT%" GOTO :NOTINSTALLED) + +REM 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@" +GOTO :INSTALLED + +:NOTINSTALLED +ECHO WARNING: This is a raw, uninstalled pear.bat + +REM Check to see if we can grab the directory of this file (Windows NT+) +IF %~n0 == pear ( +FOR %%x IN (cli\php.exe php.exe) DO (if "%%~$PATH:x" NEQ "" ( +SET "PHP_PEAR_PHP_BIN=%%~$PATH:x" +echo Using PHP Executable "%PHP_PEAR_PHP_BIN%" +"%PHP_PEAR_PHP_BIN%" -v +GOTO :NEXTTEST +)) +GOTO :FAILAUTODETECT +:NEXTTEST +IF "%PHP_PEAR_PHP_BIN%" NEQ "" ( + +REM We can use this PHP to run a temporary php file to get the dirname of pear + +echo ^ > ~~getloc.php +"%PHP_PEAR_PHP_BIN%" ~~getloc.php +set /p PHP_PEAR_BIN_DIR=fakeprompt < ~a.a +DEL ~a.a +DEL ~~getloc.php +set "PHP_PEAR_INSTALL_DIR=%PHP_PEAR_BIN_DIR%pear" + +REM Make sure there is a pearcmd.php at our disposal + +IF NOT EXIST %PHP_PEAR_INSTALL_DIR%\pearcmd.php ( +IF EXIST %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php COPY %PHP_PEAR_INSTALL_DIR%\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST pearcmd.php COPY pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +IF EXIST %~dp0\scripts\pearcmd.php COPY %~dp0\scripts\pearcmd.php %PHP_PEAR_INSTALL_DIR%\pearcmd.php +) +) +GOTO :INSTALLED +) ELSE ( +REM Windows Me/98 cannot succeed, so allow the batch to fail +) +:FAILAUTODETECT +echo WARNING: failed to auto-detect pear information +:INSTALLED + +REM 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 +REM 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 -n -d date.timezone=UTC -d output_buffering=1 -d safe_mode=0 -d "include_path='%PHP_PEAR_INSTALL_DIR%'" -d register_argc_argv="On" -d variables_order=EGPCS -f "%PHP_PEAR_INSTALL_DIR%\peclcmd.php" -- %1 %2 %3 %4 %5 %6 %7 %8 %9 +:END @ECHO ON \ No newline at end of file diff --git a/WEB-INF/lib/pear/scripts/peclcmd.php b/WEB-INF/lib/pear/scripts/peclcmd.php index 498caafd..1c8bcb6b 100644 --- a/WEB-INF/lib/pear/scripts/peclcmd.php +++ b/WEB-INF/lib/pear/scripts/peclcmd.php @@ -12,15 +12,16 @@ * @author Tomas V.V.Cox * @copyright 1997-2009 The Authors * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: peclcmd.php 313023 2011-07-06 19:17:11Z dufuz $ * @link http://pear.php.net/package/PEAR */ /** * @nodep Gtk */ -if ('@include_path@' != '@'.'include_path'.'@') { - ini_set('include_path', '@include_path@'); +//the space is needed for windows include paths with trailing backslash +// http://pear.php.net/bugs/bug.php?id=19482 +if ('@include_path@ ' != '@'.'include_path'.'@ ') { + ini_set('include_path', trim('@include_path@ '). PATH_SEPARATOR . get_include_path()); $raw = false; } else { // this is a raw, uninstalled pear, either a cvs checkout, or php distro diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 2d0ded6a..fd63ce69 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.9.31.3531 | Copyright © Anuko | +  Anuko Time Tracker 1.9.31.3532 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1