understanding spamblock bee plugin...

Creating and modifying plugins.
blog.brockha.us
Regular
Posts: 695
Joined: Tue Jul 03, 2007 3:34 am
Location: Berlin, Germany
Contact:

Re: understanding spamblock bee plugin...

Post by blog.brockha.us »

Found the problem..

Janek added a constructor to the plugin that is not compatible with the s9y plugin framework :? :

Code: Select all

    function serendipity_event_spamblock_bee() {
Replace this line with these two lines and the plugin will save its configuration correctly again:

Code: Select all

    function serendipity_event_spamblock_bee($instance) {
        $this->instance = $instance;
I will put an update to Spartacus fixing that.

Btw..

I thing, because of changes made for PHP5 it is a very bad idea to add constructors to plugins, as the code for constructor inheritance is not safe over all PHP versions.

At the moment

parent::serendipity_event($instance)

would work, but it the S9Y framework is updated to PHP5 with new constructors, this code would crash.

This is a question for the PHP gurus (I am not! :lol:). How do we assure constructor inheritance working? By always using old style constructors?

The fun part: Even the plugin framework itself is not using constructor inheritance but is reproducing the constructor code instead (as I did for the bee fix).

(OOP in PHP is a complete mess IMHO..)
- Grischa Brockhaus - http://blog.brockha.us
- Want to make me happy? http://wishes.brockha.us/
Post Reply