diff --git a/Scribunto.php b/Scribunto.php index 0a7d4e8c..429767f7 100644 --- a/Scribunto.php +++ b/Scribunto.php @@ -62,7 +62,6 @@ $wgAutoloadClasses['Scribunto_LuaEngineTestSkip'] = $wgHooks['SoftwareInfo'][] = 'ScribuntoHooks::getSoftwareInfo'; $wgHooks['ParserFirstCallInit'][] = 'ScribuntoHooks::setupParserHook'; -$wgHooks['ParserLimitReport']['scribunto'] = 'ScribuntoHooks::reportLimits'; $wgHooks['ParserLimitReportPrepare'][] = 'ScribuntoHooks::reportLimitData'; $wgHooks['ParserLimitReportFormat'][] = 'ScribuntoHooks::formatLimitData'; $wgHooks['ParserClearState'][] = 'ScribuntoHooks::clearState'; diff --git a/common/Base.php b/common/Base.php index 0493a419..4f49d03e 100644 --- a/common/Base.php +++ b/common/Base.php @@ -274,16 +274,6 @@ abstract class ScribuntoEngineBase { return array_merge( $coreLibraryPaths, $extraLibraryPaths ); } - /** - * Get text for the limit report, old style - * - * @deprecated - * @return string - */ - public function getLimitReport() { - return ''; - } - /** * Add limit report data to a ParserOutput object * diff --git a/common/Hooks.php b/common/Hooks.php index b256ad43..2d6c42db 100644 --- a/common/Hooks.php +++ b/common/Hooks.php @@ -270,22 +270,6 @@ class ScribuntoHooks { return true; } - /** - * Adds report of number of evaluations by the single wikitext page. - * - * @deprecated - * @param Parser $parser - * @param string $report - * @return bool - */ - public static function reportLimits( Parser $parser, &$report ) { - if ( Scribunto::isParserEnginePresent( $parser ) ) { - $engine = Scribunto::getParserEngine( $parser ); - $report .= $engine->getLimitReport(); - } - return true; - } - /** * Adds report of number of evaluations by the single wikitext page. * @@ -294,10 +278,6 @@ class ScribuntoHooks { * @return bool */ public static function reportLimitData( Parser $parser, ParserOutput $output ) { - // Unhook the deprecated hook, since the new one exists. - global $wgHooks; - unset( $wgHooks['ParserLimitReport']['scribunto'] ); - if ( Scribunto::isParserEnginePresent( $parser ) ) { $engine = Scribunto::getParserEngine( $parser ); $engine->reportLimitData( $output ); diff --git a/engines/LuaSandbox/Engine.php b/engines/LuaSandbox/Engine.php index 963adef6..86748f60 100644 --- a/engines/LuaSandbox/Engine.php +++ b/engines/LuaSandbox/Engine.php @@ -106,23 +106,6 @@ class Scribunto_LuaSandboxEngine extends Scribunto_LuaEngine { return $ret; } - public function getLimitReport() { - $data = $this->getLimitReportData(); - $lang = Language::factory( 'en' ); - - $t = $this->interpreter->getCPUUsage(); - $s = 'Lua time usage: ' . sprintf( "%.3f", $data['scribunto-limitreport-timeusage'] ) . "s\n" . - 'Lua memory usage: ' . $lang->formatSize( $data['scribunto-limitreport-memusage'] ) . "\n"; - if ( isset( $data['scribunto-limitreport-profile'] ) ) { - $s .= "Lua Profile:\n"; - $format = " %-59s %8.0f ms %8.1f%%\n"; - foreach ( $data['scribunto-limitreport-profile'] as $line ) { - $s .= sprintf( $format, $line[0], $line[1], $line[2] ); - } - } - return $s; - } - public function reportLimitData( ParserOutput $output ) { $data = $this->getLimitReportData(); foreach ( $data as $k => $v ) { diff --git a/engines/LuaStandalone/LuaStandaloneEngine.php b/engines/LuaStandalone/LuaStandaloneEngine.php index 3f1c9944..9736c805 100644 --- a/engines/LuaStandalone/LuaStandaloneEngine.php +++ b/engines/LuaStandalone/LuaStandaloneEngine.php @@ -20,29 +20,6 @@ class Scribunto_LuaStandaloneEngine extends Scribunto_LuaEngine { ]; } - /** - * @return string - */ - function getLimitReport() { - try { - $this->load(); - } catch ( Exception $e ) { - return ''; - } - if ( !$this->initialStatus ) { - return ''; - } - $status = $this->interpreter->getStatus(); - $lang = Language::factory( 'en' ); - return - 'Lua time usage: ' . sprintf( "%.3f", $status['time'] / $this->getClockTick() ) . "s\n" . - 'Lua virtual size: ' . - $lang->formatSize( $status['vsize'] ) . ' / ' . - $lang->formatSize( $this->options['memoryLimit'] ) . "\n" . - 'Lua estimated memory usage: ' . - $lang->formatSize( $status['vsize'] - $this->initialStatus['vsize'] ) . "\n"; - } - function reportLimitData( ParserOutput $output ) { try { $this->load();