Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.12

Bug #4278 Parser V1: error handling borked !
Submitted: 2005-05-04 11:24 UTC
From: toggg Assigned: cellog
Status: Closed Package: PEAR
PHP Version: Irrelevant OS: irrelevant
Roadmaps: (Not assigned)    

 [2005-05-04 11:24 UTC] toggg
Description: ------------ As each morning I updated from CVS: # pear -V PEAR Version: 1.4.0a12 PHP Version: 4.3.11 Zend Engine Version: 1.3.0 Running on: Linux 2.6.11-1.14_FC3smp #1 SMP Thu Apr 7 19:38:19 EDT 2005 i686 # pear download-all Using Channel PHP Fatal error: Call to a member function on a non-object in /usr/share/pear/PEAR/PackageFile/Parser/v1.php on line 88 # pear upgrade -f package2.xml PHP Fatal error: Call to a member function on a non-object in /usr/share/pear/PEAR/PackageFile/Parser/v1.php on line 88 Some package file on the server contains some "Stupid saxon data" It appears that some "Stupid californian code" is mixing PEAR::Error and PEAR:Error_Stack ! I patched the file and got it running. However I never saw any error message about this stupid saxon. I also did pear run-test -r in PEAR/tests ===> 19 FAILS, see below. If it's due to my changes, then everything is a miss ... or I'm a Stupid french guy :) Reproduce code: --------------- --- v1.php~ 2005-05-04 10:15:45.000000000 +0200 +++ v1.php 2005-05-04 12:32:26.000000000 +0200 @@ -80,17 +80,14 @@ function parse($data, $file, $archive = false) { if (!extension_loaded('xml')) { - $this->_stack->push(PEAR_PACKAGEFILE_ERROR_NO_XML_EXT, 'exception', array('error' => $error)); - return $this->_isValid = false; + include_once 'PEAR.php'; + return PEAR::raiseError("XML Extension not found", PEAR_PACKAGEFILE_ERROR_NO_XML_EXT); } $test = $this->preProcessStupidSaxon($data); - if ($test != $data) { - $this->_stack->push(PEAR_PACKAGEFILE_ERROR_NON_ISO_CHARS, 'warning'); - } $xp = @xml_parser_create(); if (!$xp) { - $this->_stack->push(PEAR_PACKAGEFILE_ERROR_CANT_MAKE_PARSER, 'exception'); - return $this->_isValid = false; + include_once 'PEAR.php'; + return PEAR::raiseError("XML cannot make parser", PEAR_PACKAGEFILE_ERROR_CANT_MAKE_PARSER); } xml_set_object($xp, $this); xml_set_element_handler($xp, '_element_start_1_0', '_element_end_1_0');@@ -124,6 +121,9 @@ if (isset($this->_logger)) { $pf->setLogger($this->_logger); } + if ($test != $data) { + $pf->_stack->push(PEAR_PACKAGEFILE_ERROR_NON_ISO_CHARS, 'warning');+ } $pf->setPackagefile($file, $archive); $pf->fromArray($this->_packageInfo); return $pf; @@ -465,4 +465,4 @@ // }}} } -?> \ No newline at end of file +?> Expected result: ---------------- FAIL PEAR_PackageFile_Generator_v1->toV2(), test extension src package[PEAR_PackageFile_Generator_v1/toV2/test_extension1.phpt] FAIL PEAR_Installer->sortPackagesForUninstall() - real-world example (uninstall the SOAP package)[PEAR_Installer/test_sortPackagesForUninstall_SOAPpackage.phpt]FAIL PEAR_Config->getREST()[PEAR_Config/test_getREST.phpt] FAIL PEAR_Config->set() and PEAR_Config->get()[PEAR_Config/test_setget_channelvalues.phpt] FAIL remote-list command[PEAR_Command_Remote/remote-list/test.phpt] FAIL clear-cache command[PEAR_Command_Remote/clear-cache/test.phpt] FAIL download-all command[PEAR_Command_Mirror/download-all/test_normal.phpt] FAIL download-all command, preferred_state = alpha[PEAR_Command_Mirror/download-all/test_normal_alpha.phpt] FAIL download-all command, --channel option[PEAR_Command_Mirror/download-all/test_normal_channel.phpt] FAIL upgrade-all command - real-world example from Bug #3388[PEAR_Command_Install/upgrade-all/test.phpt] FAIL upgrade command, test for bug #4060 - install/upgrade of package with an os installcondition * fails[PEAR_Command_Install/upgrade/test_bug4060.phpt] FAIL uninstall command - real-world example (uninstall the SOAP package)[PEAR_Command_Install/uninstall/test_uninstallSOAP.phpt] FAIL install command, simplest possible test[PEAR_Command_Install/install/test_bug3550.phpt] FAIL config-show command failure[PEAR_Command_Config/config-show/test.phpt] FAIL channel-info command (channel.xml file)[PEAR_Command_Channels/channel-info/test_file.phpt] FAIL channel-info command (channel.xml file, invalid channel.xml)[PEAR_Command_Channels/channel-info/test_file_fail.phpt] FAIL channel-info command (installed channel)[PEAR_Command_Channels/channel-info/test_installed.phpt] FAIL channel-info command (remote channel.xml file)[PEAR_Command_Channels/channel-info/test_remotefile.phpt] FAIL PEAR_Channelfile->resetFunctions() (rest)[PEAR_Channelfile/test_resetfunctions_rest.phpt] 19 FAILED TESTS:


 [2005-05-04 11:59 UTC] toggg
Hacked to get the list of failing packages: Benchmark (Hmmmm...) File_Find HTML_Template_PHPLIB HTTP_Upload MDB Payment_DTA Structures_Graph Translation XML_Transformer XML_Tree Why is the analysis made twice as my output revealed ?
 [2005-05-12 02:53 UTC] cellog
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on In case this was a website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.