Page 1 of 1

Weather plugin woes

Posted: Thu Jan 06, 2005 6:20 pm
by Little Hamster
I installed a fresh copy of serendipity on my PC to debug the problem I have with the weather plugin. Setup is apache2, php4, mysql on linux. Service_Weather is 1.3.1 from

Basically, the plugin doesn't show anything on the front page, but messed up the configure plugin page.

After adding a generous amount of echos to the plugin code, I've pinpointed the offending line:

Code: Select all

$status = $metar->setCache('file', array('cache_dir' => '/tmp'));

Using the version of the plugin mgroeninger pm'ed me has the same problem. In his version (I think it's from the CVS), it's like this:

Code: Select all

$status = $metar->setCache('file', array('cache_dir' => $serendipity['serendipityPath'].'/templates_c'));

I created /path/to/s9y/templates_c and made sure it's 777.

Since I'm not fluent in php, I can't really tell what has gone wrong here. The only thing I can think of is $metar. But it should have been instantiated because this is called before the offending line:

Code: Select all


Need PEAR Cache

Posted: Thu Jan 06, 2005 6:29 pm
by Little Hamster
OK, I've figured out what went wrong. You need the PEAR::Cache installed as well, or service->setCache will just die without a sound.

Maybe someone with CVS access can add a require() there? Or maybe the plugin can check if Cache exists before setCache()?

Posted: Thu Jan 06, 2005 9:46 pm
by mgroeninger
Ok, I should have fixed this in CVS...
I added two configuation options as well:
    Caching: You can now turn caching on and off
    Cache Directory: You can now set the cache directory

If caching is on, but PEAR/cache is not installed it should give you a polite warning on the sidebar...

Same as if services/weather isn't installed...

I tested it in both 0.8 and 0.7.1 and it seems to be working...

anonymous CVS should catch up in a few hours... if you don't want to wait, send me a message...

Thanks Little Hamster!!!

Posted: Thu Jan 06, 2005 9:49 pm
by mgroeninger
Oh, yeah... if anyone wants to translate the prompts let me know!!