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

Request #16803 Caching without cache
Submitted: 2009-11-19 04:18 UTC
From: yunosh Assigned: eru
Status: Closed Package: Services_Weather (version 1.4.5)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 26 - 6 = ?

 
 [2009-11-19 04:18 UTC] yunosh (Jan Schneider)
Description: ------------ At least the weather.com driver is calling _parseWeatherData() in every method. Common use cases call several methods of a Services_Weather instance, not only one. If you don't use a cache, this leads to subsequent requests to the weather.com API for each method call. With my patch for the location bug, there even two requests for a single getWeather() or getForecast() call. If no cache is being provided, the weather data should at least be cached in a static variable in the Services_Weather instance, so that at least for a single instance, the API is only requested once, if necessary. This would even be an improvement if using a cache, because the cache doesn't have to be queried.

Comments

 [2009-12-08 19:03 UTC] doconnor (Daniel O'Connor)
static ? :( I'm getting that whole "global state" vibe all over again...
 [2009-12-08 19:49 UTC] yunosh (Jan Schneider)
Make it a property.
 [2011-07-27 22:25 UTC] eru (Alexander Wirtz)
-Status: Open +Status: Closed -Assigned To: +Assigned To: eru
This bug has been fixed in SVN. 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. Thanks for the suggestion, please test, if possible! Best regards, Alexander