PHP Class phpbb\textreparser\base

Inheritance: implements phpbb\textreparser\reparser_interface
Datei anzeigen Open project: phpbb/phpbb

Protected Properties

Property Type Description
$name The reparser name
$save_changes Whether to save changes to the database

Public Methods

Method Description
disable_save ( ) Disable saving changes to the database
enable_save ( ) Enable saving changes to the database
get_max_id ( )
get_name ( ) : string Returns the name of the reparser
reparse_range ( $min_id, $max_id )
set_name ( string $name ) Sets the name of the reparser

Protected Methods

Method Description
add_missing_fields ( array $record ) : array Add fields to given record, if applicable
get_records_by_range ( integer $min_id, integer $max_id ) : array Return all records in given range
guess_bbcode ( array $record, string $bbcode ) : boolean Guess whether given BBCode is in use in given record
guess_bbcodes ( array $record ) : boolean Guess whether any BBCode is in use in given record
guess_magic_url ( array $record ) : boolean Guess whether magic URLs are in use in given record
guess_smilies ( array $record ) : boolean Guess whether smilies are in use in given record
reparse_record ( array $record ) Reparse given record
save_record ( array $record )

Method Details

add_missing_fields() protected method

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
protected add_missing_fields ( array $record ) : array
$record array Original record
return array Complete record

disable_save() public method

Disable saving changes to the database
public disable_save ( )

enable_save() public method

Enable saving changes to the database
public enable_save ( )

get_max_id() abstract public method

abstract public get_max_id ( )

get_name() public method

Returns the name of the reparser
public get_name ( ) : string
return string Name of reparser

get_records_by_range() abstract protected method

Return all records in given range
abstract protected get_records_by_range ( integer $min_id, integer $max_id ) : array
$min_id integer Lower bound
$max_id integer Upper bound
return array Array of records

guess_bbcode() protected method

Guess whether given BBCode is in use in given record
protected guess_bbcode ( array $record, string $bbcode ) : boolean
$record array
$bbcode string
return boolean

guess_bbcodes() protected method

Guess whether any BBCode is in use in given record
protected guess_bbcodes ( array $record ) : boolean
$record array
return boolean

guess_magic_url() protected method

Guess whether magic URLs are in use in given record
protected guess_magic_url ( array $record ) : boolean
$record array
return boolean

guess_smilies() protected method

Guess whether smilies are in use in given record
protected guess_smilies ( array $record ) : boolean
$record array
return boolean

reparse_range() public method

public reparse_range ( $min_id, $max_id )

reparse_record() protected method

Reparse given record
protected reparse_record ( array $record )
$record array Associative array containing the record's data

save_record() abstract protected method

abstract protected save_record ( array $record )
$record array

set_name() public method

Sets the name of the reparser
public set_name ( string $name )
$name string The reparser name

Property Details

$name protected_oe property

The reparser name
protected $name

$save_changes protected_oe property

Whether to save changes to the database
protected $save_changes