Using Injector instead of Object::useCustomClass to replace single method.

75 views
Skip to first unread message

schippie

unread,
Jan 31, 2015, 10:19:34 AM1/31/15
to silverst...@googlegroups.com
Since the forums are being spammed to death again i thought i would repost this here instead. Since i am still looking for help regarding this. 
Also could i maybe suggest using a pre-build forum software like Xenforo? which has seemingly (from lots of personal experience) a far better protection against spam. Or at the very least build in this functionality: http://stopforumspam.com/ which i have done on qutie a few MyBB based forum websites. 

======================================================

I want to override the Member->update() functionality and seeing as this is not possible through data Extensions and their are no hooks in the update function i was wondering what the correct way of doing this is? I tried it through the injector pattern but this did not really help me much seeing as now the Member table is not even created anymore when i use a structure along the form of:

config.yml

Injector:
  Member:
    class: CustomMember

CustomerMember:

class CustomMember extends Member
{
    public function update($data)  {
        return parent::update($data);
    }
}

And while i probably could do this through the Object:useCustomClass() i was wondering if this was possible through the Injector in anyway to only overwrite one single method.

Edit

I just tried it on the Member class but this is pointless in the current situation even with Object:useCustomClass() seeing as DataObject:get() does not look through this list. And simply grabs the class you use instead of any class that might overwrite this. 
So i am now really looking for a way to overwrite build in functionality like update or delete for for example Member

Cam Findlay

unread,
Feb 1, 2015, 7:39:41 PM2/1/15
to silverst...@googlegroups.com
Schippie... is this meant to be two separate posts? FYI, we are already running stopforumspam plus a number of other counter measures - we are catching the majority of spam that comes in, however there are a few accounts that get through still (as these are human spammers). 

I'll be following up with some more spam improvements again soon, and looking at the analytics we are tracking we have managed to drop the volume of new spam accounts by around 37% over the last 9 days since we made changes. I'll continue to work on this.

schippie

unread,
Feb 3, 2015, 4:59:31 PM2/3/15
to silverst...@googlegroups.com
Was more a repost of what i had posted on the forums, though decided to point out the spam problem as well.
Now the spam is gone i could probably bump the forum post on the forums again unless somebody here has an answer to this problem i am facing.

Reply all
Reply to author
Forward
0 new messages