hongaar / semalt-blocker

:no_entry: Self-updating PHP library which blocks referral spam from ruining your website statistics
http://nabble.nl/semalt/
MIT License
67 stars 5 forks source link

Add own referer #23

Closed Creat1veM1nd closed 4 years ago

Creat1veM1nd commented 8 years ago

Hello,

so far, your scripts work without problem! Thanks for coding it!

I do have a question though: is it possible to provide a file which contains additional referer for blocking and which is not overwritten by autoupdate ?

Thanks!

Dragon013

hongaar commented 8 years ago

I think it'd be best if the Blocklist would be abstracted away in its own class. Right now this is simply handled by calling file_get_contents in the Blocker class. Feel free to submit a PR, I will also see if I can make time for this in the near future (and fix the Travis errors).

Creat1veM1nd commented 7 years ago

Sadly I am not familiar with how to work with GitHub, so I would like to note down my changes right here. It's quick and dirty, but so far, it works.

Right on the beginning I added: private static $ownBlocklist = './../../domains/ownBlocked';

Above the method for getting the Blocklist (getBlocklistFilename) I added: ` /**

The method for reading the blocklist (getBlocklistContents) I replaced with: ` /**

The format of the own blocked file is the same as "blocked"