PHP Weather has been rewritten

PHP Weather

I’ve rewritten PHP Weather, so that it uses objects. And it actually works, so I think we’re almost done for version 2. You can download it here.

I sent a mail to the maillinglist, but here it is as well:

I’ve also tried to write some documentation for the new version, which is included in the tarball. I used a php-script called PHPDoc. It works by reading comments in the code, and then build HTML-pages with that information.

It’s not finished yet, but I think we’re getting really close now. The main advantages of this structure is:

  • It is easy to add support for new database-engines. Basically they just have to support three methods: insert_metar(), update_metar() and get_metar().

    I’ve made a database-engine called ‘none‘ which doesn’t do anything, and one called ‘mysql‘ which is fully working. I hope that someone will write an engine for PostgreSQL, dbm etc.

  • The translators are able to override the output-routines, if that is necessary. And at the same time, most languages only need to translate the English language-file, just like old times :-)

    I’ve made an English language-file. It’s probably missing some strings, since I changed the keys in the $strings-array quite a bit while I was coding. When a string is missing, PHP complains about an undefined index. If you get such an error, then please report it to this list.

I know that there’s still some problems with getting it to work under PHP3, which should be solved. We’ll have to try and identify the cause of these problems, and then make a fix.

So, what do you think? Is it any good? Please report any failures and successes you get — thanks.

Leave a comment