Permalink
Browse files

Bug #16099 PEAR crash on PHP4 (parse error)

git-svn-id: http://svn.php.net/repository/pear/pear-core/pear/pear-core/trunk@278722 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 02a622d commit 0647f680870817deec6cd9ed24486f83da2e285c dufuz committed Apr 15, 2009
Showing with 70 additions and 122 deletions.
  1. +1 −32 PEAR.php
  2. +33 −0 PEAR5.php
  3. +16 −7 package-PEAR.xml
  4. +20 −83 package2.xml
View
@@ -763,38 +763,7 @@ function loadExtension($ext)
}
if (PEAR_ZE2) {
- /**
- * This is only meant for PHP 5 to get rid of certain strict warning
- * that doesn't get hidden since it's in the shutdown function
- */
- class PEAR5
- {
- /**
- * 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 = &PEAR5::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.
- */
- static function &getStaticProperty($class, $var)
- {
- static $properties;
- if (!isset($properties[$class])) {
- $properties[$class] = array();
- }
-
- if (!array_key_exists($var, $properties[$class])) {
- $properties[$class][$var] = null;
- }
-
- return $properties[$class][$var];
- }
- }
+ include_once 'PEAR5.php';
}
// {{{ _PEAR_call_destructors()
View
@@ -0,0 +1,33 @@
+<?php
+/**
+ * This is only meant for PHP 5 to get rid of certain strict warning
+ * that doesn't get hidden since it's in the shutdown function
+ */
+class PEAR5
+{
+ /**
+ * 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 = &PEAR5::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.
+ */
+ static function &getStaticProperty($class, $var)
+ {
+ static $properties;
+ if (!isset($properties[$class])) {
+ $properties[$class] = array();
+ }
+
+ if (!array_key_exists($var, $properties[$class])) {
+ $properties[$class][$var] = null;
+ }
+
+ return $properties[$class][$var];
+ }
+}
View
@@ -87,16 +87,12 @@ http://pear.php.net/dtd/package-1.0.xsd">
</maintainer>
</maintainers>
<release>
- <version>1.8.0</version>
- <date>2009-04-10</date>
+ <version>1.8.1</version>
+ <date>2009-04-15</date>
<license>New BSD License</license>
<state>stable</state>
<notes>
- * Fix Bug #14792: Bad md5sum for files with replaced content [dufuz]
- * Fix Bug #16057:-r is limited to 4 directories in depth [dufuz]
- * Fix Bug #16077: PEAR5::getStaticProperty does not return a reference to the property [dufuz]
-
- Remove custom XML_Util class in favor of using upstream XML_Util package as dependency
+ * Fix Bug #16099 PEAR crash on PHP4 (parse error) [dufuz]
</notes>
<provides type="class" name="OS_Guess"/>
<provides type="class" name="System"/>
@@ -271,6 +267,9 @@ http://pear.php.net/dtd/package-1.0.xsd">
<file role="php" name="13.php">
<replace from="@package_version@" to="version" type="package-info"/>
</file>
+ <file role="php" name="14.php">
+ <replace from="@package_version@" to="version" type="package-info"/>
+ </file>
</dir>
<dir name="Task">
<dir name="Postinstallscript">
@@ -430,6 +429,7 @@ http://pear.php.net/dtd/package-1.0.xsd">
<file role="php" name="PEAR.php">
<replace from="@package_version@" to="version" type="package-info"/>
</file>
+ <file role="php" name="PEAR5.php" />
<file role="doc" name="README" />
<file role="php" name="System.php">
<replace from="@package_version@" to="version" type="package-info"/>
@@ -617,5 +617,14 @@ Alpha1 Release Notes:
Move codebase from the PHP License to New BSD 2 clause license
</notes>
</release>
+ <release>
+ <version>1.8.1</version>
+ <date>2009-04-15</date>
+ <license>New BSD License</license>
+ <state>stable</state>
+ <notes>
+ * Fix Bug #16099 PEAR crash on PHP4 (parse error) [dufuz]
+ </notes>
+ </release>
</changelog>
</package>
View
@@ -85,97 +85,18 @@ http://pear.php.net/dtd/package-2.0.xsd">
<email>mj@php.net</email>
<active>no</active>
</helper>
- <date>2009-04-10</date>
+ <date>2009-04-15</date>
<version>
- <release>1.8.0</release>
- <api>1.8.0</api>
+ <release>1.8.1</release>
+ <api>1.8.1</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://opensource.org/licenses/bsd-license.php New BSD License">New BSD License</license>
<notes>
-Changes since RC1:
- * Fix Bug #14792: Bad md5sum for files with replaced content [dufuz]
- * Fix Bug #16057:-r is limited to 4 directories in depth [dufuz]
- * Fix Bug #16077: PEAR5::getStaticProperty does not return a reference to the property [dufuz]
-
- Remove custom XML_Util class in favor of using upstream XML_Util package as dependency
-
-RC1 Release Notes:
- * Fix Bug #14331: pear cvstag only works from inside the package directory [dufuz]
- * Fix Bug #16045: E_Notice: Undefined index: channel in PEAR/DependencyDB.php [dufuz]
-
- * Implemented Request #11230: better error message when mirror not in channel.xml file [dufuz]
- * Implemented Request #13150: Add support for following HTTP 302 redirects [dufuz]
-
-Alpha1 Release Notes:
- * Implement Request #10373: if pref_state=stable and installed package=beta, allow up to latest beta version [dufuz]
- * Implement Request #10581: login / logout should map to channel-login / channel-logout [dufuz]
- * Implement Request #10825: Only display the "invalid or missing package file"-error if it makes sense [dufuz]
- * Implement Request #11170: script to generate Command/[command].xml [dufuz]
- * Implement Request #11176: improve channel ... has updated its protocols message [dufuz]
- * Implement Request #12706: pear list -a hard to read [dufuz]
- * Implement Request #11353: upgrade-all and upgrade commands to upgrade within the same stability level [dufuz]
- * Implement Request #13015: Add https discovery for channel.xml [dufuz / initial patch by Martin Roos]
- * Implement Request #13927: install-pear.php should have option to set www_dir [timj]
- * Implement Request #14324: Make the pear install command behave similar to apt-get [dufuz]
- * Implement Request #14325: make pear upgrade with no params behave like pear upgrade-all [dufuz]
- - upgrade-all can be considered deprecated in favor of calling upgrade with no parameters to replicate
- better what other package managers are doing. upgrade-all will still work as intended.
- * Implement Request #14504: add a channel parameter support to the upgrade function [dufuz]
- - Options -c ezc and --channel=ezc got added to upgrade and upgrade-all to allow for
- channel specific upgrades
- * Implement Request #14556: install-pear-nozlib.phar should get download_dir config and other options [cweiske]
- * Implement Request #15566: Add doc.php.net as a default channel [dufuz / saltybeagle]
-
- * Fix PHP Bug #43857: --program-suffix not always reflected everywhere [cellog]
- * Fix PHP Bug #47323: strotime warnings in make install [dufuz]
-
- * Fix Bug #13908: pear info command and maintainers inactive not mentioned [dufuz]
- * Fix Bug #13926: install-pear.php does not set cfg_dir if -d option set with no -c option [timj]
- * Fix Bug #13943: tests fail when php.exe path contains spaces [dufuz / jorrit]
- * Fix Bug #13953: config-set/config-show with channel alias fail [cellog]
- * Fix Bug #13958: When a phpt tests exit() or die() xdebug coverage is not generated, patch by izi (David Jean Louis) [izi / dufuz]
- * Fix Bug #14041: Unpredictable unit test processing sequence [dufuz]
- * Fix Bug #14140: Strict warning not suppressed in the shutdown function [dufuz]
- * Fix Bug #14210: pear list -ia brings warnings [dufuz]
- * Fix Bug #14274: PEAR packager mangles package.xml encoding, then complains about it [dufuz]
- * Fix Bug #14287: cannot upgrade from stable to beta via -beta when config is set to stable [dufuz]
- * Fix Bug #14300: Package files themselves can not be served over https [dufuz / initial patch by Martin Roos]
- * Fix Bug #14437: openbasedir warning when loading config [dufuz]
- * Fix Bug #14558: PackageFile.php creates tmp directory outside configured temp_dir [cweiske]
- * Fix Bug #14947: downloadHttp() is missing Host part of the HTTP Request when using Proxy [ifeghali]
- * Fix Bug #14977: PEAR/Frontend.php doesn't require_once PEAR.php [dufuz]
- * Fix Bug #15750: Unreachable code in PEAR_Downloader [dufuz]
- * Fix Bug #15979: Package files incorrectly removed when splitting a package into multiple pkgs [dufuz]
- * Fix Bug #15914: pear upgrade installs different version if desired version not found [dufuz]
-
- NOTE!
- Functions that have been deprecated for 3+ years in PEAR_Common, please take a moment
- to migrate over to one of the alternatives that have ben provided:
- * PEAR_Common->downloadHttp (use PEAR_Downloader->downloadHttp instead)
- * PEAR_Common->infoFromTgzFile (use PEAR_PackageFile->fromTgzFile instead)
- * PEAR_Common->infoFromDescriptionFile (use PEAR_PackageFile->fromPackageFile instead)
- * PEAR_Common->infoFromString (use PEAR_PackageFile->fromXmlstring instead)
- * PEAR_Common->infoFromArray (use PEAR_PackageFile->fromAnyFile instead)
- * PEAR_Common->xmlFromInfo (use a PEAR_PackageFile_v* object's generator instead)
- * PEAR_Common->validatePackageInfo (use the validation of PEAR_PackageFile objects)
- * PEAR_Common->analyzeSourceCode (use a PEAR_PackageFile_v* object instead)
- * PEAR_Common->detectDependencies (use PEAR_Downloader_Package->detectDependencies instead)
- * PEAR_Common->buildProvidesArray (use PEAR_PackageFile_v1->_buildProvidesArray or
- PEAR_PackageFile_v2_Validator->_buildProvidesArray)
-
- PHP 4.4 and 5.1.6 are now the minimum PHP requirements, for brave souls
- pear upgrade -f PEAR will allow people with lower versions
- to upgrade to this release but no guarantees will be made that it will work properly.
-
- Support for XML RPC channels has been dropped - The only ones that used it
- (pear.php.net and pecl.php.net) have used the REST interface for years now.
- SOAP support also removed as it was only proof of concept.
-
- Move codebase from the PHP License to New BSD 2 clause license
+ * Fix Bug #16099 PEAR crash on PHP4 (parse error) [dufuz]
</notes>
<contents>
<dir name="/">
@@ -499,6 +420,7 @@ Alpha1 Release Notes:
<file name="LICENSE" role="doc" />
<file name="INSTALL" role="doc" />
<file name="package.dtd" role="data" />
+ <file name="PEAR5.php" role="php" />
<file name="PEAR.php" role="php">
<tasks:replace from="@package_version@" to="version" type="package-info" />
</file>
@@ -820,5 +742,20 @@ Alpha1 Release Notes:
Move codebase from the PHP License to New BSD 2 clause license
</notes>
</release>
+ <release>
+ <date>2009-04-15</date>
+ <version>
+ <release>1.8.1</release>
+ <api>1.8.1</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://opensource.org/licenses/bsd-license.php New BSD License">New BSD License</license>
+ <notes>
+ * Fix Bug #16099 PEAR crash on PHP4 (parse error) [dufuz]
+ </notes>
+ </release>
</changelog>
</package>

0 comments on commit 0647f68

Please sign in to comment.