Spam_score.php

Summary
Spam_score.php
Spam_scoreScore of a notice by activity spam service
Spam_scoreScore of a notice per the activity spam service
schemaDefReturns an array containing the layout of the database table for the purposes of maintenance tools to understand the database.
saveNewCreate a new spam score for a notice using a provider.
saveAs saveNew but does duplication checking and a few other things.
deleteDelete a spam score entry
upgradePerform some basic maintanence functions when ./scripts/upgrade.php is run.
upgradeScaledFinds entries in the database where the `scaled` attribute is NULL and updates them with the appropriate value.
upgradeIsSpamFinds entries in the database where the `is_spam` attribute is NULL and updates them with the appropriate value.
upgradeNoticeCreatedFinds entries in the database where the `notice_created` attribute is NULL and updates them with the appropriate value.
scaleScale the score given from a provider to our internal maximum.

Spam_score

Score of a notice by activity spam service

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Score of a notice by activity spam service

PHP version

Tested with PHP 7

File Authors

Web

Spam_score

Score of a notice per the activity spam service

Defines

  • MAX_SCALE - 10000

Variables

  • $__table - ‘spam_score’
  • $notice_id - int
  • $score - float
  • $created - datetime
Summary
schemaDefReturns an array containing the layout of the database table for the purposes of maintenance tools to understand the database.
saveNewCreate a new spam score for a notice using a provider.
saveAs saveNew but does duplication checking and a few other things.
deleteDelete a spam score entry
upgradePerform some basic maintanence functions when ./scripts/upgrade.php is run.
upgradeScaledFinds entries in the database where the `scaled` attribute is NULL and updates them with the appropriate value.
upgradeIsSpamFinds entries in the database where the `is_spam` attribute is NULL and updates them with the appropriate value.
upgradeNoticeCreatedFinds entries in the database where the `notice_created` attribute is NULL and updates them with the appropriate value.
scaleScale the score given from a provider to our internal maximum.

schemaDef

public static function schemaDef()

Returns an array containing the layout of the database table for the purposes of maintenance tools to understand the database.

Returns

  • array

saveNew

function saveNew($notice,
$result)

Create a new spam score for a notice using a provider.  Called from the provider to do so.

Parameters

  • notice - notice the spam score is for
  • result - spam score of the notice

Return

  • Spam_score score - new Spam_score object

save

function save($notice,
$result)

As saveNew but does duplication checking and a few other things.  If an existing spam score is there for the notice, we update it, rather than creating a new object.

Parameters

  • notice - notice the spam score is for
  • result - spam score of the notice

Return

  • Spam_score score - new Spam_score object

delete

function delete($useWhere = false)

Delete a spam score entry

upgrade

public static function upgrade()

Perform some basic maintanence functions when ./scripts/upgrade.php is run.

upgradeScaled

protected static function upgradeScaled()

Finds entries in the database where the `scaled` attribute is NULL and updates them with the appropriate value.

upgradeIsSpam

protected static function upgradeIsSpam()

Finds entries in the database where the `is_spam` attribute is NULL and updates them with the appropriate value.

upgradeNoticeCreated

protected static function upgradeNoticeCreated()

Finds entries in the database where the `notice_created` attribute is NULL and updates them with the appropriate value.

scale

public static function scale($score)

Scale the score given from a provider to our internal maximum.

public static function schemaDef()
Returns an array containing the layout of the database table for the purposes of maintenance tools to understand the database.
function saveNew($notice,
$result)
Create a new spam score for a notice using a provider.
function save($notice,
$result)
As saveNew but does duplication checking and a few other things.
function delete($useWhere = false)
Delete a spam score entry
public static function upgrade()
Perform some basic maintanence functions when ./scripts/upgrade.php is run.
protected static function upgradeScaled()
Finds entries in the database where the `scaled` attribute is NULL and updates them with the appropriate value.
protected static function upgradeIsSpam()
Finds entries in the database where the `is_spam` attribute is NULL and updates them with the appropriate value.
protected static function upgradeNoticeCreated()
Finds entries in the database where the `notice_created` attribute is NULL and updates them with the appropriate value.
public static function scale($score)
Scale the score given from a provider to our internal maximum.