PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » Services_Weather » Bug #5653

I've made some tweaks

Details

Request #5653I've made some tweaks
Submitted2005-10-11 02:03 UTC
Fromseth at pricepages dot org
StatusBogus
PackageServices_Weather
PHP VersionIrrelevant
OSMac
Roadmaps(Not assigned)

Comments

[2005-10-11 02:03 UTC] seth at pricepages dot org

Description:
------------
I've made some tweaks to Services_Weather where I thought
that it would be useful for others also. I'm working with
METAR and Weatherdotcom, so all of my changes are there. The
icon support should be usable in any class where it is
needed, but it has only been added to METAR in this package.
The moon phases are also automatically calculated for METAR
and Weatherdotcom, but could also easily be added to any
other class. As mentioned below, I think that finding the
update unix timestamp and including it in the returned array
would be the most useful, but I've only implemented it in
METAR and Weatherdotcom. I also only use HTTP_Request for
Metar data (and not Taf). If there is interest, I can add it
where appropriate.

Changes are as follows:
- Set Weatherdotcom Location cache time as outlined in usage
document.
- Use HTTP_Request to receive the Metar data (if
applicable). This way we can set the time out and we don't
need fopen_wrappers enabled.
- Prefetch Links/CC/Location all in one query and cache it
if we are making a related query.
- Cache the Weatherdotcom->searchLocation() results for long
time (as outlined in usage document, kind of) (I removed
unneeded if...else nesting to make it more readable)
- Removed unreachable code and initialized arrays that were
throwing warnings in the PHPEclipse IDE.
- Removed newline after each class.
-Added missing argument in Weatherdotcom code:
$this->setAccountData($options["partnerID"]); to
$this->setAccountData($options["partnerID"], '');
-Removed an extra slash from the retrieval URL of METAR
-Added support for finding the GMT sunrise/set of any point
on the globe in Common.
-Added support for deriving a good weather icon number in
METAR (in Common).
- I think that it would be more useful to have the date/time
info as GMT instead of (or in addition to) a textual
representation. That way I can use the time without parsing
it in my wrapper class.

If any bugs are found, tell me about them and I'll do my
best to fix them.

[2005-10-11 02:05 UTC] seth at pricepages dot org

URL of updated files:
http://pricepages.org/pear/Weather.zip

[2005-10-12 16:36 UTC] eru at php dot net

Let's stay on email contact on this one, as the topic will generate too much traffic and the bugs-system is clumsy in that way.