Manages URIs for the linked data interface.
More...
|
| __construct (Title $interfaceTitle, array $supportedExtensions, array $cachePaths, EntityTitleLookup $entityTitleLookup) |
|
| getExtension ( $format) |
|
| getFormatName ( $extension) |
|
| parseDocName ( $doc) |
| Parser for the file-name like document name syntax for specifying an entity data document. More...
|
|
| getDocName (EntityId $id, $format='') |
| Returns the canonical subpage name used to address a given set of entity data. More...
|
|
| getDocTitle (EntityId $id, $format='') |
| Returns a Title representing the given document. More...
|
|
| getDocUrl (EntityId $id, $format='', $revision=0) |
| Returns a Title representing the given document. More...
|
|
| getCacheableUrls (EntityId $id, int $revision=0) |
| Returns a list of all cacheable URLs for all the formats of the given entity. More...
|
|
| getPotentiallyCachedUrls (EntityId $id, int $revision=0) |
| Similar to getCacheableUrls(), but returns internal URLs (to be sent to HtmlCacheUpdater), rather than canonical URLs (against which a request URL may be compared). More...
|
|
|
| getCacheUrl (string $path, string $entityId, int $revision, string $server) |
| Turn a cache path from the config into a full URL. More...
|
|
Manages URIs for the linked data interface.
- Copyright
- GPL-2.0-or-later
- Author
- Daniel Kinzler
◆ __construct()
Wikibase\Repo\LinkedData\EntityDataUriManager::__construct |
( |
Title |
$interfaceTitle, |
|
|
array |
$supportedExtensions, |
|
|
array |
$cachePaths, |
|
|
EntityTitleLookup |
$entityTitleLookup |
|
) |
| |
- Parameters
-
Title | $interfaceTitle | |
string[] | $supportedExtensions | an associative Array mapping canonical format names to file extensions. |
string[] | $cachePaths | List of additional URL paths for which entity data should be cached, with {entity_id} and {revision_id} placeholders. |
EntityTitleLookup | $entityTitleLookup | |
◆ getCacheableUrls()
Wikibase\Repo\LinkedData\EntityDataUriManager::getCacheableUrls |
( |
EntityId |
$id, |
|
|
int |
$revision = 0 |
|
) |
| |
Returns a list of all cacheable URLs for all the formats of the given entity.
- Parameters
-
EntityId | $id | |
int | $revision | Revision ID for which to build URLs, or 0 for latest-revision URLs. |
- Returns
- string[] canonical URLs
◆ getCacheUrl()
Wikibase\Repo\LinkedData\EntityDataUriManager::getCacheUrl |
( |
string |
$path, |
|
|
string |
$entityId, |
|
|
int |
$revision, |
|
|
string |
$server |
|
) |
| |
|
private |
Turn a cache path from the config into a full URL.
- Parameters
-
string | $path | The path, with {entity_id} and {revision_id} placeholders. |
string | $entityId | The entity ID serialization. |
int | $revision | The revision ID. |
string | $server | Either $wgCanonicalServer or $wgInternalServer, depending on what kind of URL you want. |
- Returns
- string A full URL that can be compared against request URLs or sent to HtmlCacheUpdater, depending on $server.
◆ getDocName()
Wikibase\Repo\LinkedData\EntityDataUriManager::getDocName |
( |
EntityId |
$id, |
|
|
|
$format = '' |
|
) |
| |
Returns the canonical subpage name used to address a given set of entity data.
- Parameters
-
EntityId | $id | The entity |
string | null | $format | The (normalized) format name, or '' |
- Returns
- string
◆ getDocTitle()
Wikibase\Repo\LinkedData\EntityDataUriManager::getDocTitle |
( |
EntityId |
$id, |
|
|
|
$format = '' |
|
) |
| |
Returns a Title representing the given document.
- Parameters
-
EntityId | $id | The entity |
string | null | $format | The (normalized) format name, or '' |
- Returns
- Title|null
◆ getDocUrl()
Wikibase\Repo\LinkedData\EntityDataUriManager::getDocUrl |
( |
EntityId |
$id, |
|
|
|
$format = '' , |
|
|
|
$revision = 0 |
|
) |
| |
Returns a Title representing the given document.
- Parameters
-
EntityId | $id | The entity |
string | null | $format | The (normalized) format name, or '' |
int | $revision | |
- Returns
- string|null
◆ getExtension()
Wikibase\Repo\LinkedData\EntityDataUriManager::getExtension |
( |
|
$format | ) |
|
- Parameters
-
string | $format | a canonical format name |
- Returns
- string|null a file extension (without the leading dot), or null.
◆ getFormatName()
Wikibase\Repo\LinkedData\EntityDataUriManager::getFormatName |
( |
|
$extension | ) |
|
- Parameters
-
string | $extension | file extension |
- Returns
- string|null the canonical format name (or null)
◆ getPotentiallyCachedUrls()
Wikibase\Repo\LinkedData\EntityDataUriManager::getPotentiallyCachedUrls |
( |
EntityId |
$id, |
|
|
int |
$revision = 0 |
|
) |
| |
Similar to getCacheableUrls(), but returns internal URLs (to be sent to HtmlCacheUpdater), rather than canonical URLs (against which a request URL may be compared).
- Parameters
-
- Returns
- string[] internal URLs
◆ parseDocName()
Wikibase\Repo\LinkedData\EntityDataUriManager::parseDocName |
( |
|
$doc | ) |
|
Parser for the file-name like document name syntax for specifying an entity data document.
This does not validate or interpret the ID or format, it just splits the string.
- Parameters
-
- Returns
- string[] A 2-element array in the form [ string $id, string $format ]
◆ $cachePaths
Wikibase\Repo\LinkedData\EntityDataUriManager::$cachePaths |
|
private |
◆ $entityTitleLookup
Wikibase\Repo\LinkedData\EntityDataUriManager::$entityTitleLookup |
|
private |
◆ $interfaceTitle
Wikibase\Repo\LinkedData\EntityDataUriManager::$interfaceTitle |
|
private |
◆ $supportedExtensions
Wikibase\Repo\LinkedData\EntityDataUriManager::$supportedExtensions |
|
private |
The documentation for this class was generated from the following file: