Parser
class Parser extends ParserBase
Properties
protected array | $config | from ParserBase | |
protected Parser | $parser | from ParserBase | |
static protected Client | $client | ||
static protected string|null | $clientCacheDir |
Methods
No description
Add named captures from a set of regular expressions to a set of attributes
Return a set of attributes for given URL based on a site's config
Return a cached instance of the HTTP client
Return the siteId that corresponds to given URL
Interpolate {@vars} in given string
Scrape values and add them to current attributes
Retrieve external content
Details
in
ParserBase at line 30
final
__construct(Parser $parser, array $config)
Constructor
in
ParserBase at line 43
protected void
setUp()
Plugin's setup
at line 30
void
parse(string $text, array $matches)
No description
at line 57
static void
filterTag(Tag $tag, Parser $tagStack, array $hosts, array $sites, string|null $cacheDir)
Filter a MEDIA tag
This will always invalidate the original tag, and possibly replace it with the tag that corresponds to the media site
at line 85
static protected bool
addNamedCaptures(array $attributes, string $string, array $regexps)
Add named captures from a set of regular expressions to a set of attributes
at line 111
static protected Tag
createTag(string $tagName, Parser $tagStack, Tag $tag)
Create a tag for a media embed
at line 139
static protected array
getAttributes(string $url, array $config, string|null $cacheDir)
Return a set of attributes for given URL based on a site's config
at line 157
static protected Client
getHttpClient(string|null $cacheDir)
Return a cached instance of the HTTP client
at line 175
static protected string
getSiteIdFromUrl(string $url, array $hosts)
Return the siteId that corresponds to given URL
at line 197
static protected string
interpolateVars(string $str, array $vars)
Interpolate {@vars} in given string
at line 218
static protected void
scrape(array $attributes, string $url, array $config, string|null $cacheDir)
Scrape values and add them to current attributes
at line 243
static protected string
wget(string $url, string|null $cacheDir, array $config)
Retrieve external content