Page 2 of 2

Re: understanding spamblock bee plugin...

Posted: Tue Sep 25, 2012 12:09 pm
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..)