Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F10770553
WithScribunto.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
WithScribunto.php
View Options
<?php
namespace
Nasqueron\SAAS\MediaWiki
;
trait
WithScribunto
{
public
static
function
enableScribunto
()
:
void
{
self
::
registerScribuntoExtensions
();
self
::
registerScribuntoConfiguration
();
}
private
function
registerScribuntoConfiguration
()
:
void
{
foreach
(
self
::
getScribuntoConfiguration
()
as
$setting
=>
$value
)
{
// TODO: use ??= here when available.
if
(!
isset
(
$GLOBALS
[
'wg'
.
$setting
]))
{
$GLOBALS
[
'wg'
.
$setting
]
=
$value
;
}
}
$GLOBALS
[
'wgDefaultUserOptions'
][
'usebetatoolbar'
]
=
true
;
if
(
Environment
::
isBSD
())
{
$GLOBALS
[
'wgScribuntoEngineConf'
][
'luastandalone'
][
'luaPath'
]
=
'/usr/local/bin/lua51'
;
}
}
private
static
function
registerScribuntoExtensions
()
:
void
{
foreach
(
self
::
getScribuntoExtensions
()
as
$extension
)
{
$GLOBALS
[
'saasUseExtension'
.
$extension
]
=
true
;
}
}
private
static
function
getScribuntoConfiguration
()
:
array
{
return
[
'ScribuntoDefaultEngine'
=>
'luastandalone'
,
'ScribuntoUseGeSHi'
=>
true
,
'ScribuntoUseCodeEditor'
=>
true
,
];
}
private
static
function
getScribuntoExtensions
()
:
array
{
return
[
'WikiEditor'
,
'SyntaxHighlight_GeSHi'
,
'CodeEditor'
,
'Scribunto'
,
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jul 28, 09:46 (7 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2831726
Default Alt Text
WithScribunto.php (1 KB)
Attached To
Mode
rSAASMW SaaS MediaWiki
Attached
Detach File
Event Timeline
Log In to Comment