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

Bug #4167 Package unusable
Submitted: 2005-04-16 20:15 UTC
From: joe at joestump dot net Assigned: jystewart
Status: Closed Package: Services_Technorati
PHP Version: Irrelevant OS: Any
Roadmaps: (Not assigned)    
Subscription  


 [2005-04-16 20:15 UTC] joe at joestump dot net
Description: ------------ After fixing the parse error I've already reported I'm getting the following problems in PHP5: Notice: Undefined variable: url in /usr/lib/php/Services/Technorati.php on line 410 Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /usr/lib/php/Services/Technorati.php on line 410 Notice: Undefined variable: url in /usr/lib/php/Services/Technorati.php on line 417 Warning: join() [function.join]: Bad arguments. in /usr/lib/php/Services/Technorati.php on line 417 Notice: Undefined property: Services_Technorati::$_cache in /usr/lib/php/Services/Technorati.php on line 421 Fatal error: Call to a member function get() on a non-object in /usr/lib/php/Services/Technorati.php on line 421 Looking at the code I've found some things I find problematic: 1.) You use Services_Technorati::_checkOptions() in all of your functions (not bad), but you aren't checking the results of that function. Check out topTags() as an example. If the result of _checkOptions is a PEAR_Error shouldn't the function quit and return the error? 2.) You're using a variable called $url in the function which, as far as I can tell, is not defined anywhere in the function and you don't expect it as an option. What is this variable? Where does it come from? 3.) Your array_merge() call fails because you're attempting to merge a PEAR_Error and an array. 4.) You don't check to see if the person is using caching or not. Each call to $this->_cach->whatever() should be wrapped or prepended with if ($this->_cache !== false) or something like that. The biggest problem is the fact that you use this $url all over the place and it's not defined anywhere that I can find - that and the cache variable is called blindly.

Comments

 [2005-04-16 21:07 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!