Aller au contenu

omnishield/stopforumspam Référence de l’API

Étage
Fournisseur · Omnishield
Version
1.x
Suite de conformité
branchée, CI non lue
Vérifié en réel
Vérifié en réel
Licence
MIT
composer require omnishield/stopforumspam:1.x-dev

Lue dans les fichiers PHP du paquet au commit f06bd4c01fc7 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnishield\Stopforumspam

  • StopforumspamGateway class

    StopForumSpam's API (https://www.stopforumspam.com/usage): one POST - so that nothing of the visitor shows in an address a proxy logs - with ip, email or emailhash, username and json; for each part asked, whether it appears, how often (frequency, 255 for StopForumSpam's own blacklists), when last (lastseen, UTC), how surely (confidence, a percentage), and torexit for a Tor exit node.

    6 methods · 2 constants

  • StopforumspamGatewayFactory class

    StopForumSpam: are this IP address, this e-mail, this name reported for abuse. Looking up needs no key; reporting does.

    9 options · 1 method

Omnishield\Stopforumspam

StopforumspamGateway class

final class StopforumspamGateway implements ReputationInterface StopforumspamGateway.php:29

StopForumSpam's API (https://www.stopforumspam.com/usage): one POST - so that nothing of the visitor shows in an address a proxy logs - with ip, email or emailhash, username and json; for each part asked, whether it appears, how often (frequency, 255 for StopForumSpam's own blacklists), when last (lastseen, UTC), how surely (confidence, a percentage), and torexit for a Tor exit node.

A part counts when it appears and its confidence reaches the threshold: StopForumSpam gives a confidence even for an address that no longer appears (expire), and a reported address seen three times long ago scores under 1.

const BASE_URI = 'https://api.stopforumspam.org/api'
const REPORT_URI = 'https://www.stopforumspam.com/add'

StopforumspamGateway::__construct()

public function __construct(readonly HttpClientInterface $http, readonly float $threshold = 50, readonly array $send = ['ip', 'email', 'name'], readonly bool $hashEmail = true, readonly ?int $expire = null, readonly string $tor = 'neutral', readonly bool $wildcards = true, readonly ?string $apiKey = null, readonly string $baseUri = self::BASE_URI, readonly string $reportUri = self::REPORT_URI)

StopforumspamGateway::getName()

public function getName(): string

StopforumspamGateway::getTitle()

public function getTitle(): string

StopforumspamGateway::capabilities()

public function capabilities(): Capabilities

StopforumspamGateway::lookup()

public function lookup(Identity $identity): Reputation

StopforumspamGateway::report()

public function report(Identity $identity, string $evidence = ''): void

Reports a spammer to StopForumSpam: their address, e-mail and name - all three, StopForumSpam takes nothing less - and what they posted, as evidence. Needs an API key of StopForumSpam's.

StopforumspamGatewayFactory class

final class StopforumspamGatewayFactory extends GatewayFactory StopforumspamGatewayFactory.php:33

StopForumSpam: are this IP address, this e-mail, this name reported for abuse. Looking up needs no key; reporting does.

options: threshold: 50 # the confidence (0-100) from which a match counts send: [ip, email, name] # what of the visitor is sent - the address leaves the site: say so in the privacy policy hash_email: true # the e-mail as its MD5 (emailhash), not in clear; StopForumSpam then normalises nothing (Gmail's dots, +tags) expire: ~ # days: a sighting older than that does not count tor: neutral # neutral: a Tor exit node counts as reported; ignore: never; block: always wildcards: true # false: StopForumSpam's own lists of hostile domains, names and networks left out (nobadall) api_key: '%env(default::STOPFORUMSPAM_API_KEY)%' # only to report a spammer base_uri: https://api.stopforumspam.org/api # europe.stopforumspam.org, us.stopforumspam.org to stay in a region report_uri: https://www.stopforumspam.com/add

StopForumSpam's terms (https://www.stopforumspam.com/usage, read on 2026-10-07): 100,000 queries a day, non-commercial use - a commercial system may use the data for its own, internal use -, and not as a firewall: ask about the people who submit a form, never about every visitor.

Options

OptionDefault
threshold50
send['ip', 'email', 'name']
hash_emailtrue
expirenull
tor'neutral'
wildcardstrue
api_keynull
base_uriStopforumspamGateway::BASE_URI
report_uriStopforumspamGateway::REPORT_URI

StopforumspamGatewayFactory::__construct()

public function __construct(readonly ?HttpClientInterface $http = null)