Go to the documentation of this file.
62 abstract protected function newModule( $text, $chunkName );
77 abstract public function runConsole( array $params );
105 $this->parser =
null;
107 $this->modules =
null;
131 return $this->options[$optionName] ??
null;
148 if ( $this->title ) {
166 if ( !array_key_exists( $key, $this->modules ) ) {
167 list( $text, $finalTitle ) = $this->parser->fetchTemplateAndTitle(
$title );
168 if ( $text ===
false ) {
169 $this->modules[$key] =
null;
173 $finalKey = $finalTitle->getPrefixedDBkey();
174 if ( !isset( $this->modules[$finalKey] ) ) {
175 $this->modules[$finalKey] = $this->
newModule( $text, $finalKey );
178 $this->modules[$key] = $this->modules[$finalKey];
180 return $this->modules[$key];
191 public function validate( $text, $chunkName =
false ) {
192 $module = $this->
newModule( $text, $chunkName );
193 return $module->validate();
249 protected function getLibraries( $engine, array $coreLibraries = [] ) {
250 $extraLibraries = [];
251 Hooks::run(
'ScribuntoExternalLibraries', [ $engine, &$extraLibraries ] );
252 return $coreLibraries + $extraLibraries;
263 $extraLibraryPaths = [];
264 Hooks::run(
'ScribuntoExternalLibraryPaths', [ $engine, &$extraLibraryPaths ] );
265 return array_merge( $coreLibraryPaths, $extraLibraryPaths );
350 abstract public function validate();
359 abstract public function invoke( $name, $frame );
runConsole(array $params)
Run an interactive console request.
getCodeEditorLanguage()
Get the language for Ace code editor.
getPrefixedDBkey()
Get the prefixed database key form.
__construct(ScribuntoEngineBase $engine, $code, $chunkName)
getOption( $optionName)
Get an element from the configuration array.
reportLimitData(ParserOutput $output)
Add limit report data to a ParserOutput object.
formatLimitData( $key, &$value, &$report, $isHTML, $localize)
Format limit report data.
getSoftwareInfo(array &$software)
Get software information for Special:Version.
getGeSHiLanguage()
Get the language for GeSHi syntax highlighter.
ScribuntoModuleBase[] $modules
__construct(array $options)
Class that represents a module.
getLibraryPaths( $engine, array $coreLibraryPaths=[])
Load a list of all paths libraries can be in for this engine.
fetchModuleFromParser(Title $title)
Load a module from some parser-defined template loading mechanism and register a parser output depend...
validate( $text, $chunkName=false)
Validates the script and returns a Status object containing the syntax errors for the given code.
getLibraries( $engine, array $coreLibraries=[])
Load a list of all libraries supported by this engine.
getDefaultExceptionParams()
validate()
Validates the script and returns a Status object containing the syntax errors for the given code.
ScribuntoEngineBase $engine
Wikitext scripting infrastructure for MediaWiki: base classes.
An exception class which represents an error in the script.
invoke( $name, $frame)
Invoke the function with the specified name.
newModule( $text, $chunkName)
Creates a new module object within this engine.
Represents a title within MediaWiki.
newException( $message, array $params=[])
getResourceUsage( $resource)
Get CPU and memory usage information, if the script engine provides it.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.