From f386ff68d5fe9973c8bd2fad940441ff377a6265 Mon Sep 17 00:00:00 2001 From: Reedy Date: Thu, 6 Jun 2019 15:13:20 +0100 Subject: [PATCH] Remove PHP entry point Move NS constants to seperate file for static analysis Bug: T140007 Change-Id: I525c6e5b1c8e934d179e330c89f3f29cce335bd6 --- .phan/config.php | 2 +- Scribunto.constants.php | 6 +++ Scribunto.php | 99 ----------------------------------------- 3 files changed, 7 insertions(+), 100 deletions(-) create mode 100644 Scribunto.constants.php delete mode 100644 Scribunto.php diff --git a/.phan/config.php b/.phan/config.php index 2d802dd0..fe5a59a3 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -2,7 +2,7 @@ $cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php'; -$cfg['file_list'][] = 'Scribunto.php'; +$cfg['file_list'][] = 'Scribunto.constants.php'; $cfg['directory_list'] = array_merge( $cfg['directory_list'], diff --git a/Scribunto.constants.php b/Scribunto.constants.php new file mode 100644 index 00000000..65b659fd --- /dev/null +++ b/Scribunto.constants.php @@ -0,0 +1,6 @@ + [ - 'class' => 'Scribunto_LuaSandboxEngine', - 'memoryLimit' => 50 * 1024 * 1024, - 'cpuLimit' => 7, - - // The profiler sample period, or false to disable the profiler - 'profilerPeriod' => 0.02, - - // Set this to true to allow setfenv() and getfenv() in user code. - // 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 - // simulation of setfenv() and getfenv() will be provided. - 'allowEnvFuncs' => false, - - // 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 - // $wgLocalisationCacheConf['manualRecache'] = false - // then memory usage is perhaps 10x smaller. - 'maxLangCacheSize' => 30, - ], - 'luastandalone' => [ - 'class' => 'Scribunto_LuaStandaloneEngine', - - // A filename to act as the destination for stderr from the Lua - // binary. This may provide useful error information if Lua fails to - // 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, - 'memoryLimit' => 50 * 1024 * 1024, - 'cpuLimit' => 7, - 'allowEnvFuncs' => false, - 'maxLangCacheSize' => 30, - ], - 'luaautodetect' => [ - 'factory' => 'Scribunto_LuaEngine::newAutodetectEngine', - ], -]; - -/** - * Set to true to enable the SyntaxHighlight_GeSHi extension - */ -$wgScribuntoUseGeSHi = true; - -/** - * Set to true to enable the CodeEditor extension - */ -$wgScribuntoUseCodeEditor = true; - -/** - * Set to true to enable gathering and reporting of performance data - * for slow function invocations. - */ -$wgScribuntoGatherFunctionStats = false; - -/** - * 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;