class OpenSearchDescription

The OpenSearch description, which lets browsers add the forum as a search engine and suggest its discussions as someone types.

Constants

MAX_DESCRIPTION_LENGTH

MAX_IMAGE_BYTES

The room embedded images may take: Chrome ignores a description over 50,000 bytes, and the rest of it takes a few thousand at most.

NS

MOZ_NS

Properties

protected Cloud $assets

Methods

__construct( SettingsRepositoryInterface $settings, ShortName $shortName, Branding $branding, IconSet $icons, UrlGenerator $url, Repository $cache, Factory $filesystemFactory)

No description

string
build()

No description

void
element( DOMElement $parent, string $name, array $attributes = [], string|null $text = null)

No description

string
searchPage()

The discussion list, where a search runs. The frontend serves it at the forum's root when it is the homepage, and then has nothing at /all.

string
xmlText(string $text)

Text without the control characters XML can't contain, which a setting pasted from elsewhere may have.

string
description()

No description

array
images()

The favicon, embedded rather than linked: Firefox refuses linked icons over 10KB, and an embedded one doesn't depend on where assets are served.

array
favicon(string $path)

No description

Details

__construct( SettingsRepositoryInterface $settings, ShortName $shortName, Branding $branding, IconSet $icons, UrlGenerator $url, Repository $cache, Factory $filesystemFactory)

Parameters

SettingsRepositoryInterface $settings
ShortName $shortName
Branding $branding
IconSet $icons
UrlGenerator $url
Repository $cache
Factory $filesystemFactory

string build()

Return Value

string

protected void element( DOMElement $parent, string $name, array $attributes = [], string|null $text = null)

Parameters

DOMElement $parent
string $name
array $attributes
string|null $text

Return Value

void

string searchPage()

The discussion list, where a search runs. The frontend serves it at the forum's root when it is the homepage, and then has nothing at /all.

Any other homepage ignores the query.

Return Value

string

protected string xmlText(string $text)

Text without the control characters XML can't contain, which a setting pasted from elsewhere may have.

Parameters

string $text

Return Value

string

protected string description()

Return Value

string

protected array images()

The favicon, embedded rather than linked: Firefox refuses linked icons over 10KB, and an embedded one doesn't depend on where assets are served.

Images that would make the document too big for Chrome are left out, and Chrome then shows the forum's /favicon.ico. Kept for a day by where the favicon is stored, which changes when it is replaced, so it isn't read and resized on every request.

Return Value

array width, height, type and data: URI

protected array favicon(string $path)

Parameters

string $path

Return Value

array width, height, type and data