abstract class base implements reparser_interface

Properties

protected string $name
protected bool $save_changes

Methods

int
get_max_id()

Return the highest ID for all existing records

array
get_records_by_range(int $min_id, int $max_id)

Return all records in given range

void
save_record(array $record)

Save record

array
add_missing_fields(array $record)

Add fields to given record, if applicable

string
get_name()

Returns the name of the reparser

set_name(string $name)

Sets the name of the reparser

disable_save()

Disable saving changes to the database

enable_save()

Enable saving changes to the database

bool
guess_bbcode(array $record, string $bbcode)

Guess whether given BBCode is in use in given record

bool
guess_bbcodes(array $record)

Guess whether any BBCode is in use in given record

bool
guess_magic_url(array $record)

Guess whether magic URLs are in use in given record

bool
guess_smilies(array $record)

Guess whether smilies are in use in given record

reparse_range(int $min_id, int $max_id, bool $force_bbcode_reparsing = false)

Reparse all records in given range

reparse_record(array $record, bool $force_bbcode_reparsing = false)

Reparse given record

Details

at line 31
abstract int get_max_id()

Return the highest ID for all existing records

Return Value

int

at line 40
abstract protected array get_records_by_range(int $min_id, int $max_id)

Return all records in given range

Parameters

int $min_id

Lower bound

int $max_id

Upper bound

Return Value

array

Array of records

at line 48
abstract protected void save_record(array $record)

Save record

Parameters

array $record

Return Value

void

at line 59
protected array add_missing_fields(array $record)

Add fields to given record, if applicable

The enable_* fields are not always saved to the database. Sometimes we need to guess their original value based on the text content or possibly other fields

Parameters

array $record

Original record

Return Value

array

Complete record

at line 105
string get_name()

Returns the name of the reparser

Return Value

string

Name of reparser

at line 115
set_name(string $name)

Sets the name of the reparser

Parameters

string $name

The reparser name

at line 123
disable_save()

Disable saving changes to the database

at line 131
enable_save()

Enable saving changes to the database

at line 143
protected bool guess_bbcode(array $record, string $bbcode)

Guess whether given BBCode is in use in given record

Parameters

array $record
string $bbcode

Return Value

bool

at line 175
protected bool guess_bbcodes(array $record)

Guess whether any BBCode is in use in given record

Parameters

array $record

Return Value

bool

at line 202
protected bool guess_magic_url(array $record)

Guess whether magic URLs are in use in given record

Parameters

array $record

Return Value

bool

at line 214
protected bool guess_smilies(array $record)

Guess whether smilies are in use in given record

Parameters

array $record

Return Value

bool

at line 222
reparse_range(int $min_id, int $max_id, bool $force_bbcode_reparsing = false)

Reparse all records in given range

Parameters

int $min_id

Lower bound

int $max_id

Upper bound

bool $force_bbcode_reparsing

Flag indicating if BBCode should be reparsed unconditionally

at line 236
protected reparse_record(array $record, bool $force_bbcode_reparsing = false)

Reparse given record

Parameters

array $record

Associative array containing the record's data

bool $force_bbcode_reparsing

Flag indicating if BBCode should be reparsed unconditionally