2012-01-28 16:22:18 +00:00
|
|
|
<?php
|
|
|
|
|
2017-06-24 00:53:28 +00:00
|
|
|
if ( function_exists( 'wfLoadExtension' ) ) {
|
|
|
|
wfLoadExtension( 'Scribunto' );
|
|
|
|
// Keep i18n globals so mergeMessageFileList.php doesn't break
|
|
|
|
$wgMessagesDirs['Scribunto'] = __DIR__ . '/i18n';
|
|
|
|
$wgExtensionMessagesFiles['ScribuntoMagic'] = __DIR__ . '/Scribunto.magic.php';
|
|
|
|
$wgExtensionMessagesFiles['ScribuntoNamespaces'] = __DIR__ . '/Scribunto.namespaces.php';
|
2018-10-26 19:53:22 +00:00
|
|
|
wfWarn(
|
2017-06-24 00:53:28 +00:00
|
|
|
'Deprecated PHP entry point used for Scribunto extension. Please use wfLoadExtension instead,' .
|
|
|
|
' see https://www.mediawiki.org/wiki/Extension_registration for more details.'
|
2018-10-26 19:53:22 +00:00
|
|
|
);
|
2017-06-24 00:53:28 +00:00
|
|
|
return true;
|
|
|
|
} else {
|
2018-10-26 19:53:22 +00:00
|
|
|
die( 'This version of the Scribunto extension requires MediaWiki 1.31+' );
|
2016-05-17 14:52:05 +00:00
|
|
|
}
|
2012-01-28 16:22:18 +00:00
|
|
|
|
2017-06-24 00:53:28 +00:00
|
|
|
/**
|
|
|
|
* The rest of this file is a PHP stub for providing documentation
|
|
|
|
* about the various configuration settings for Scribunto, as well
|
|
|
|
* as providing hints for IDEs. It is not executed by MediaWiki.
|
|
|
|
*/
|
2012-01-28 16:22:18 +00:00
|
|
|
|
2018-04-09 04:39:06 +00:00
|
|
|
define( 'NS_MODULE', 828 );
|
|
|
|
define( 'NS_MODULE_TALK', 829 );
|
|
|
|
|
2012-01-28 16:22:18 +00:00
|
|
|
/**
|
2012-04-06 05:04:30 +00:00
|
|
|
* The name of the default script engine.
|
2012-01-28 16:22:18 +00:00
|
|
|
*/
|
2017-06-24 21:58:12 +00:00
|
|
|
$wgScribuntoDefaultEngine = 'luaautodetect';
|
2012-01-28 16:22:18 +00:00
|
|
|
|
2012-04-05 07:58:02 +00:00
|
|
|
/**
|
2012-04-06 05:04:30 +00:00
|
|
|
* Configuration for each script engine
|
2012-04-05 07:58:02 +00:00
|
|
|
*/
|
2017-06-15 17:19:00 +00:00
|
|
|
$wgScribuntoEngineConf = [
|
|
|
|
'luasandbox' => [
|
2012-04-13 10:38:12 +00:00
|
|
|
'class' => 'Scribunto_LuaSandboxEngine',
|
|
|
|
'memoryLimit' => 50 * 1024 * 1024,
|
|
|
|
'cpuLimit' => 7,
|
2012-05-23 06:51:59 +00:00
|
|
|
|
2012-12-27 23:26:06 +00:00
|
|
|
// The profiler sample period, or false to disable the profiler
|
|
|
|
'profilerPeriod' => 0.02,
|
|
|
|
|
2012-09-25 07:58:42 +00:00
|
|
|
// Set this to true to allow setfenv() and getfenv() in user code.
|
2014-03-28 20:46:41 +00:00
|
|
|
// Note that these functions have been removed in Lua 5.2. Scribunto
|
|
|
|
// does not yet support Lua 5.2, but we expect support will be
|
|
|
|
// implemented in the future, and there is no guarantee that a
|
2012-05-23 06:51:59 +00:00
|
|
|
// simulation of setfenv() and getfenv() will be provided.
|
|
|
|
'allowEnvFuncs' => false,
|
2017-03-20 02:59:23 +00:00
|
|
|
|
|
|
|
// The maximum number of languages about which data can be requested.
|
|
|
|
// The cost is about 1.5MB of memory usage per language on default
|
|
|
|
// installations (during recache), but if recaching is disabled with
|
2017-07-08 13:42:23 +00:00
|
|
|
// $wgLocalisationCacheConf['manualRecache'] = false
|
2017-03-20 02:59:23 +00:00
|
|
|
// then memory usage is perhaps 10x smaller.
|
|
|
|
'maxLangCacheSize' => 30,
|
2017-06-15 17:19:00 +00:00
|
|
|
],
|
|
|
|
'luastandalone' => [
|
2012-04-13 10:38:12 +00:00
|
|
|
'class' => 'Scribunto_LuaStandaloneEngine',
|
|
|
|
|
|
|
|
// A filename to act as the destination for stderr from the Lua
|
2014-03-28 20:46:41 +00:00
|
|
|
// binary. This may provide useful error information if Lua fails to
|
2012-04-13 10:38:12 +00:00
|
|
|
// run. Set this to null to discard stderr output.
|
|
|
|
'errorFile' => null,
|
|
|
|
|
|
|
|
// The location of the Lua binary, or null to use the bundled binary.
|
|
|
|
'luaPath' => null,
|
2012-04-05 07:58:02 +00:00
|
|
|
'memoryLimit' => 50 * 1024 * 1024,
|
|
|
|
'cpuLimit' => 7,
|
2012-05-23 06:51:59 +00:00
|
|
|
'allowEnvFuncs' => false,
|
2017-03-20 02:59:23 +00:00
|
|
|
'maxLangCacheSize' => 30,
|
2017-06-15 17:19:00 +00:00
|
|
|
],
|
2017-06-24 21:58:12 +00:00
|
|
|
'luaautodetect' => [
|
|
|
|
'factory' => 'Scribunto_LuaEngine::newAutodetectEngine',
|
|
|
|
],
|
2017-06-15 17:19:00 +00:00
|
|
|
];
|
2012-01-28 16:22:18 +00:00
|
|
|
|
|
|
|
/**
|
2012-05-22 03:56:07 +00:00
|
|
|
* Set to true to enable the SyntaxHighlight_GeSHi extension
|
2012-01-28 16:22:18 +00:00
|
|
|
*/
|
2018-04-09 08:58:06 +00:00
|
|
|
$wgScribuntoUseGeSHi = true;
|
2012-01-28 16:22:18 +00:00
|
|
|
|
2012-02-06 22:14:47 +00:00
|
|
|
/**
|
2012-05-22 03:56:07 +00:00
|
|
|
* Set to true to enable the CodeEditor extension
|
2012-02-06 22:14:47 +00:00
|
|
|
*/
|
2018-04-09 08:58:06 +00:00
|
|
|
$wgScribuntoUseCodeEditor = true;
|
2012-02-06 22:14:47 +00:00
|
|
|
|
2015-10-24 23:54:11 +00:00
|
|
|
/**
|
|
|
|
* Set to true to enable gathering and reporting of performance data
|
|
|
|
* for slow function invocations.
|
|
|
|
*/
|
|
|
|
$wgScribuntoGatherFunctionStats = false;
|
|
|
|
|
2015-10-29 22:53:10 +00:00
|
|
|
/**
|
|
|
|
* If $wgScribuntoGatherFunctionStats is true, this variable specifies
|
|
|
|
* the percentile threshold for slow function invocations. Should be
|
|
|
|
* a value between 0 and 1 (exclusive).
|
|
|
|
*/
|
|
|
|
$wgScribuntoSlowFunctionThreshold = 0.90;
|