WikiLambda
MediaWiki WikiLambda extension
Loading...
Searching...
No Matches
MediaWiki\Extension\WikiLambda\Hooks Class Reference
+ Inheritance diagram for MediaWiki\Extension\WikiLambda\Hooks:
+ Collaboration diagram for MediaWiki\Extension\WikiLambda\Hooks:

Public Member Functions

 onLoadExtensionSchemaUpdates ( $updater)
 

Static Public Member Functions

static registerExtension ()
 
static createInitialContent (DatabaseUpdater $updater, $overwrite=false)
 Installer/Updater callback to create the initial "system" ZObjects on any installation.
 
static initializeZObjectJoinTable (DatabaseUpdater $updater)
 Installer/Updater callback to ensure that wikilambda_zobject_join has been populated for all existing functions (Z8s).
 
static updateSecondaryTables ( $updater, $zType, $verbose=false, $dryRun=false)
 Ensures that secondary DB tables have been populated for ZObjects of the given zType.
 

Static Protected Member Functions

static getDataPath ()
 Return path of data definition JSON files.
 
static insertContentObject ( $updater, $filename, $dependencies, $user, $comment, $overwrite=false, &$inserted=[], $track=[])
 Inserts into the database the ZObject found in a given filename of the data directory.
 

Member Function Documentation

◆ createInitialContent()

static MediaWiki\Extension\WikiLambda\Hooks::createInitialContent ( DatabaseUpdater $updater,
$overwrite = false )
static

Installer/Updater callback to create the initial "system" ZObjects on any installation.

This is a callback so that it runs after the tables have been created/updated.

Parameters
DatabaseUpdater$updater
bool$overwriteIf true, overwrites the content, else skips if present

◆ getDataPath()

static MediaWiki\Extension\WikiLambda\Hooks::getDataPath ( )
staticprotected

Return path of data definition JSON files.

Returns
string

◆ initializeZObjectJoinTable()

static MediaWiki\Extension\WikiLambda\Hooks::initializeZObjectJoinTable ( DatabaseUpdater $updater)
static

Installer/Updater callback to ensure that wikilambda_zobject_join has been populated for all existing functions (Z8s).

This is a callback so that it runs after the tables have been created/updated. This function can be removed when we are confident that all WikiLambda installations have a fully populated wikilambda_zobject_join table.

Parameters
DatabaseUpdater$updater

◆ insertContentObject()

static MediaWiki\Extension\WikiLambda\Hooks::insertContentObject ( $updater,
$filename,
$dependencies,
$user,
$comment,
$overwrite = false,
& $inserted = [],
$track = [] )
staticprotected

Inserts into the database the ZObject found in a given filename of the data directory.

First checks whether the ZObject has any dependencies, according to the dependencies.json manifest file, and if so, inserts all the dependencies before trying the current ZObject.

Runs in a static context and so can't be part of the normal code in ZObjectStore.

Parameters
DatabaseUpdater$updater
string$filename
array$dependencies
User$user
string$comment
bool$overwrite
string[]&$inserted
string[]$track
Returns
bool Has successfully inserted the content object
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ onLoadExtensionSchemaUpdates()

MediaWiki\Extension\WikiLambda\Hooks::onLoadExtensionSchemaUpdates ( $updater)
See also
https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates
Parameters
DatabaseUpdater$updaterDatabaseUpdater subclass

◆ updateSecondaryTables()

static MediaWiki\Extension\WikiLambda\Hooks::updateSecondaryTables ( $updater,
$zType,
$verbose = false,
$dryRun = false )
static

Ensures that secondary DB tables have been populated for ZObjects of the given zType.

For each such ZObject, a new instance of ZObjectSecondaryDataUpdate is created and added to DeferredUpdates.

N.B. This function assumes that wikilambda_zobject_labels is fully populated; it calls fetchZidsOfType to get a list of ZObjects of the given zType.

Note there is a WikiLambda maintenance script (updateSecondaryTables.php) that provides similar functionality (and with some code that duplicates what's here, which could not easily be avoided).

Parameters
DatabaseUpdater$updater
string$zTypeThe type of ZObject for which to do updates.
bool$verboseIf true, print the ZID of each ZObject for which updating is done (default = false)
bool$dryRunIf true, do nothing, just print the output statements (default = false)
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: