PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » Services_Technorati » Bug #4167

Package unusable

Details

Submitted2005-04-16 20:15 UTC
Fromjoe at joestump dot net
Assignedjystewart
StatusClosed
PackageServices_Technorati
PHP VersionIrrelevant
OSAny
Roadmaps(Not assigned)

Comments

[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.