See Release Notes
Long Term Support Release
Mlang PHP based on David Mudrak phpparser for local_amos.
Copyright: | 2020 Ferran Recio <ferran@moodle.com> |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 260 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
phpparser:: (6 methods):
__construct()
__clone()
get_instance()
parse()
extract_strings()
decapsulate()
__construct() X-Ref |
Prevents direct creation of object |
__clone() X-Ref |
Prevent from cloning the instance |
get_instance() X-Ref |
Get the singleton instance fo this class return: phpparser singleton instance of phpparser |
parse(string $data, int $format = 2) X-Ref |
Parses the given data in Moodle PHP string format Note: This method is adapted from local_amos as it is highly tested and robust. The priority is keeping it similar to the original one to make it easier to mantain. param: string $data definition of the associative array param: int $format the data format on the input, defaults to the one used since 2.0 return: langstring[] array of langstrings of this file |
extract_strings(string $data) X-Ref |
Low level parsing method Note: This method is adapted from local_amos as it is highly tested and robust. The priority is keeping it similar to the original one to make it easier to mantain. param: string $data return: string[] the data strings |
decapsulate(string $text) X-Ref |
Given one T_CONSTANT_ENCAPSED_STRING, return its value without quotes Also processes escaped quotes inside the text. Note: This method is taken directly from local_amos as it is highly tested and robust. param: string $text value obtained by token_get_all() return: string value without quotes |