Re: patches to use PHPWeather as a plugin for PhpWiki 1.3.3
Brought to you by:
iridium
From: Martin G. <gim...@gi...> - 2002-03-07 09:01:19
|
Carsten Klapp <car...@ma...> writes: > Hi Martin, Hi Carsten - and others :-) > With a little stumbling around I finally managed to use PHPWeather > as a plugin for PhpWiki! I'm thinking of including the plugin with > the distribution of PhpWiki (http://phpwiki.sf.net/phpwiki/) as an > example of how to write plugins, and of course because PHPWeather is > so cool too. That's really great! > There were a couple problems I encountered along the way, so I think > I will want to wait a bit before submitting my plugin to PhpWiki's > CVS. Patches included at the end of this message, based on code I > pulled down from the PHPWeather CVS today. > > * PhpWiki uses the PEAR library for database access, which already > declares db classes with the same names as the ones PHPWeather's > database code wants to use. I fixed this by prefixing the affected > classes and functions with PW_. This is probably a good idea if you > want to allow your custom DB functions to coexist with other web > apps which rely on PEAR. (PhpWiki recently has an ADODB interface > for it's sql, but it still ships "out of the box" with PEAR as the > default for sql.) I see. I think you're right about this - we ought to prefix all our functions with a common string and I guess 'pw' is the logical choice, even though it doesn't remind me of PHP Weather. > * Need a method to return the weather data as an array or just as > preformatted html string, so the calling app can position it on the > page where it wants to. For PhpWiki I just quickly modified the > pretty_print() to collect the output into a variable instead of > printing it and return that. Ahh, yes - that should have been changed a long time ago. When I started the script, I didn't think that much about it. Thanks for the patch! -- Martin Geisler My GnuPG Key: 0xF7F6B57B See my homepage at http://www.gimpster.com/ for: PHP Weather => Shows the current weather on your webpage. PHP Shell => A telnet-connection (almost :-) in a PHP page. |