Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6135474
Metadata.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Metadata.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Skins\Citizen\Partials
;
use
Exception
;
use
MediaWiki\MainConfigNames
;
use
MediaWiki\Skins\Citizen\SkinCitizen
;
use
MediaWiki\Utils\UrlUtils
;
final
class
Metadata
extends
Partial
{
public
function
__construct
(
SkinCitizen
$skin
,
private
readonly
UrlUtils
$urlUtils
)
{
parent
::
__construct
(
$skin
);
}
/**
* Adds metadata to the output page
*/
public
function
addMetadata
():
void
{
// Theme color
$this
->
out
->
addMeta
(
'theme-color'
,
$this
->
getConfigValue
(
'CitizenThemeColor'
)
??
''
);
// Generate webapp manifest
$this
->
addManifest
();
}
/**
* Adds the manifest if:
* * Enabled in 'CitizenEnableManifest'
* * User has read access (i.e. not a private wiki)
* Manifest link will be empty if wfExpandUrl throws an exception.
*/
private
function
addManifest
():
void
{
if
(
$this
->
getConfigValue
(
'CitizenEnableManifest'
)
!==
true
||
$this
->
getConfigValue
(
MainConfigNames
::
GroupPermissions
)[
'*'
][
'read'
]
!==
true
)
{
return
;
}
try
{
$href
=
$this
->
urlUtils
->
expand
(
wfAppendQuery
(
wfScript
(
'api'
),
[
'action'
=>
'webapp-manifest'
]
),
PROTO_RELATIVE
);
}
catch
(
Exception
$e
)
{
$href
=
''
;
}
$this
->
out
->
addLink
(
[
'rel'
=>
'manifest'
,
'href'
=>
$href
,
]
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 7 2026, 14:31 (8 w, 19 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b1/2b/983cf93322e7cc55c5c7e2cd81f3
Default Alt Text
Metadata.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment