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

Bug #6077 PEAR_PackageFile_Parser_v2 should return by reference
Submitted: 2005-11-25 22:34 UTC
From: farell Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 4.4.0 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-25 22:34 UTC] farell
Description: ------------ Still with PEAR 1.4.5 and PFM 1.6.0a4 during importOptions process of an existing package.xml (v1) i got a notice error Test script: --------------- <?php require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); // base of install directory $baseinstalldir = 'HTML/QuickForm'; // Configuration of PEAR::PackageFileManager $optionsUpdate = array( 'packagedirectory' => '.', 'filelistgenerator' => 'cvs', 'baseinstalldir' => $baseinstalldir, 'changelogoldtonew' => false, 'simpleoutput' => false, 'ignore' => array('package.xml', basename(__FILE__)) ); $packagefile = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'package.xml'; if (file_exists($packagefile)) { $pkg =& PEAR_PackageFileManager2::importOptions($packagefile, $optionsUpdate); } ?> Expected result: ---------------- no error message Actual result: -------------- Notice: Only variables should be assigned by reference in [...]\PEAR\PackageFileManager2.php on line 1423

Comments

 [2006-01-08 22:12 UTC] farell
Greg, About this error there are two possible solutions, depending of what you really want . 1. fix into PFM2 class http://cvs.php.net/viewcvs.cgi/pear/PEAR_PackageFileManager/PackageFileManager2.php?annotate=1.18 on lines 1422-1423 remove the reference & from return of PEAR_PackageFile_Parser_v2::parse() method, because parse() is not defined to return any reference. I don't think its necessary in this case. i've applied this change on cvs PackageFileManager2.php,v 1.21 line 1428. Easy to retrieve if you want to step back. 2. OR fix into PEAR-core declare PEAR_PackageFile_Parser_v2::parse() method to return value by reference . PEAR\PackageFile\Parser\v2.php It's up to you to choose ! Laurent
 [2006-01-23 17:39 UTC] cellog
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.