62 abstract protected function newModule( $text, $chunkName );
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 );
359 abstract public function invoke( $name, $frame );
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
Wikitext scripting infrastructure for MediaWiki: base classes.
getLibraryPaths( $engine, array $coreLibraryPaths=[])
Load a list of all paths libraries can be in for this engine.
reportLimitData(ParserOutput $output)
Add limit report data to a ParserOutput object.
getDefaultExceptionParams()
runConsole(array $params)
Run an interactive console request.
getOption( $optionName)
Get an element from the configuration array.
newException( $message, array $params=[])
getGeSHiLanguage()
Get the language for GeSHi syntax highlighter.
ScribuntoModuleBase[] $modules
getLibraries( $engine, array $coreLibraries=[])
Load a list of all libraries supported by this engine.
fetchModuleFromParser(Title $title)
Load a module from some parser-defined template loading mechanism and register a parser output depend...
getSoftwareInfo(array &$software)
Get software information for Special:Version.
newModule( $text, $chunkName)
Creates a new module object within this engine.
getResourceUsage( $resource)
Get CPU and memory usage information, if the script engine provides it.
validate( $text, $chunkName=false)
Validates the script and returns a Status object containing the syntax errors for the given code.
__construct(array $options)
getCodeEditorLanguage()
Get the language for Ace code editor.
formatLimitData( $key, &$value, &$report, $isHTML, $localize)
Format limit report data.
An exception class which represents an error in the script.
Class that represents a module.
validate()
Validates the script and returns a Status object containing the syntax errors for the given code.
invoke( $name, $frame)
Invoke the function with the specified name.
__construct(ScribuntoEngineBase $engine, $code, $chunkName)
ScribuntoEngineBase $engine
Represents a title within MediaWiki.
getPrefixedDBkey()
Get the prefixed database key form.