phpBB API Documentation
Class

phpbb\event\php_exporter

class php_exporter

Class php_exporter Crawls through a list of files and grabs all php-events

Methods

__construct(string $phpbb_root_path, mixed $extension = null, string $min_version = null, string $max_version = null)

array get_events()

Get the list of all events

null set_current_event(string $name, int $line)

Set current event data

null set_content(array $content)

Set the content of this file

int crawl_phpbb_directory_php()

Crawl the phpBB/ directory for php events

get_recursive_file_list()

Returns a list of files in $dir

string export_events_for_wiki(string $action = '')

Format the php events as a wiki table

int crawl_php_file(string $file)

string get_event_name(int $event_line, bool $is_dispatch)

Find the name of the event inside the dispatch() line

array get_vars_from_array()

Find the $vars array

array get_vars_from_single_line_array($line, $throw_multiline = true)

Find the variables in single line array

array get_vars_from_multi_line_array()

Find the variables in single line array

array get_vars_from_docblock()

Find the $vars array

int find_since()

Find the "@since" Information line

array find_changed(string $tag_name)

Find the "@changed" Information lines

int find_event()

Find the "@event" Information line

int find_tag(string $find_tag, array $disallowed_tags, int $skip_to_line)

Find a "@*" Information line

int find_description()

Find a "@*" Information line

string validate_since(string $line)

Validate "@since" Information

string validate_changed(string $line)

Validate "@changed" Information

string validate_event(string $event_name, string $line)

Validate "@event" Information

null validate_vars_docblock_array(array $vars_array, array $vars_docblock)

Validates that two arrays contain the same strings

Details

at line 55
public __construct(string $phpbb_root_path, mixed $extension = null, string $min_version = null, string $max_version = null)

Parameters

string $phpbb_root_path
mixed $extension String 'vendor/ext' to filter, null for phpBB core
string $min_version
string $max_version

at line 77
public array get_events()

Get the list of all events

Return Value

array Array with events: name => details

at line 89
public null set_current_event(string $name, int $line)

Set current event data

Parameters

string $name Name of the current event (used for error messages)
int $line Line where the current event is placed in

Return Value

null

at line 101
public null set_content(array $content)

Set the content of this file

Parameters

array $content Array with the lines of the file

Return Value

null

at line 110
public int crawl_phpbb_directory_php()

Crawl the phpBB/ directory for php events

Return Value

int The number of events found

at line 128
public get_recursive_file_list()

Returns a list of files in $dir

at line 165
public string export_events_for_wiki(string $action = '')

Format the php events as a wiki table

Parameters

string $action

Return Value

string

at line 192
public int crawl_php_file(string $file)

Parameters

string $file

Return Value

int Number of events found in this file

Exceptions

LogicException

at line 312
public string get_event_name(int $event_line, bool $is_dispatch)

Find the name of the event inside the dispatch() line

Parameters

int $event_line
bool $is_dispatch Do we look for dispatch() or trigger_event() ?

Return Value

string Name of the event

Exceptions

LogicException

at line 359
public array get_vars_from_array()

Find the $vars array

Return Value

array List of variables

Exceptions

LogicException

at line 392
public array get_vars_from_single_line_array($line, $throw_multiline = true)

Find the variables in single line array

Parameters

$line
$throw_multiline

Return Value

array List of variables

Exceptions

LogicException

at line 419
public array get_vars_from_multi_line_array()

Find the variables in single line array

Return Value

array List of variables

Exceptions

LogicException

at line 444
public array get_vars_from_docblock()

Find the $vars array

Return Value

array List of variables

Exceptions

LogicException

at line 505
public int find_since()

Find the "@since" Information line

Return Value

int Absolute line number

Exceptions

LogicException

at line 517
public array find_changed(string $tag_name)

Find the "@changed" Information lines

Parameters

string $tag_name Should be 'change', not 'changed'

Return Value

array Absolute line numbers

Exceptions

LogicException

at line 542
public int find_event()

Find the "@event" Information line

Return Value

int Absolute line number

at line 557
public int find_tag(string $find_tag, array $disallowed_tags, int $skip_to_line)

Find a "@*" Information line

Parameters

string $find_tag Name of the tag we are trying to find
array $disallowed_tags List of tags that must not appear between the tag and the actual event
int $skip_to_line Skip lines until this one

Return Value

int Absolute line number

Exceptions

LogicException

at line 603
public int find_description()

Find a "@*" Information line

Return Value

int Absolute line number

Exceptions

LogicException

at line 637
public string validate_since(string $line)

Validate "@since" Information

Parameters

string $line

Return Value

string

Exceptions

LogicException

at line 657
public string validate_changed(string $line)

Validate "@changed" Information

Parameters

string $line

Return Value

string

Exceptions

LogicException

at line 679
public string validate_event(string $event_name, string $line)

Validate "@event" Information

Parameters

string $event_name
string $line

Return Value

string

Exceptions

LogicException

at line 706
public null validate_vars_docblock_array(array $vars_array, array $vars_docblock)

Validates that two arrays contain the same strings

Parameters

array $vars_array Variables found in the array line
array $vars_docblock Variables found in the doc block

Return Value

null

Exceptions

LogicException