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

Bug #4003 importOptions() won't work until setOptions() is called
Submitted: 2005-03-30 14:31 UTC
From: scott at crisscott dot com Assigned: cellog
Status: Closed Package: PEAR_PackageFileManager
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  


 [2005-03-30 14:31 UTC] scott at crisscott dot com
Description: ------------ Before you can import options, you need to call setOptions(). importOptions() calls _getExistingPackageXML() which checks for $this->_options['pearcommonclass']. That array element is set to false until you call setOptions(). Greg suggested passing an array as an optional argument that would then be passed to setOptions() inside of importOptions() but don't think that will solve the problem. setOptions() requires several options that you are trying to set with importOptions(). You could get around this by passing a bunch of garbage, but that sounds shady to me. Another solution is to have the pear common class default to PEAR_Common if it isn't set or to have a method for setting the pear common class other than setOptions(). Reproduce code: --------------- $pf = new PEAR_PackageFileManager(); $result = $pf->importOptions('/path/to/package.xml'); if (PEAR::isError($result)) { echo $result->getMessage(); } else { print_r($pf->getOptions()); } Expected result: ---------------- Array ( 'optionName' => value ... ) Actual result: -------------- Run $managerclass->setOptions() before any other methods

Comments

 [2005-04-06 22:22 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!