MediaWiki REL1_31
|
Gadgets repo powered by MediaWiki:Gadgets-definition. More...
Public Member Functions | |
fetchStructuredList ( $forceNewText=null) | |
Fetch list of gadgets and returns it as associative array of sections with gadgets e.g. | |
getGadget ( $id) | |
getGadgetIds () | |
Get the ids of the gadgets provided by this repository. | |
handlePageUpdate (LinkTarget $target) | |
Given that the provided page was updated, invalidate caches if necessary. | |
newFromDefinition ( $definition, $category) | |
Creates an instance of this class from definition in MediaWiki:Gadgets-definition. | |
Public Member Functions inherited from GadgetRepo | |
getStructuredList () | |
Get a list of gadgets sorted by category. | |
handlePageCreation (LinkTarget $target) | |
Given that the provided page was created, invalidate caches if necessary. | |
handlePageDeletion (LinkTarget $target) | |
Given that the provided page was updated, invalidate caches if necessary. | |
Public Attributes | |
const | CACHE_VERSION = 2 |
Protected Member Functions | |
loadGadgets () | |
Loads list of gadgets and returns it as associative array of sections with gadgets e.g. | |
Private Member Functions | |
getCheckKey () | |
listFromDefinition ( $definition) | |
Generates a structured list of Gadget objects from a definition. | |
purgeDefinitionCache () | |
Purge the definitions cache, for example if MediaWiki:Gadgets-definition was edited. | |
Private Attributes | |
$definitionCache | |
Additional Inherited Members | |
Static Public Member Functions inherited from GadgetRepo | |
static | setSingleton ( $repo=null) |
Should only be used by unit tests. | |
static | singleton () |
Get the configured default GadgetRepo. | |
Gadgets repo powered by MediaWiki:Gadgets-definition.
Definition at line 10 of file MediaWikiGadgetsDefinitionRepo.php.
MediaWikiGadgetsDefinitionRepo::fetchStructuredList | ( | $forceNewText = null | ) |
Fetch list of gadgets and returns it as associative array of sections with gadgets e.g.
[ $name => $gadget1, etc. ]
string | $forceNewText | Injected text of MediaWiki:gadgets-definition [optional] |
Definition at line 126 of file MediaWikiGadgetsDefinitionRepo.php.
References $rev, $source, listFromDefinition(), and wfDebug().
|
private |
Definition at line 54 of file MediaWikiGadgetsDefinitionRepo.php.
References Gadget\GADGET_CLASS_VERSION, and wfMemcKey().
Referenced by loadGadgets(), and purgeDefinitionCache().
MediaWikiGadgetsDefinitionRepo::getGadget | ( | $id | ) |
string | $id |
InvalidArgumentException |
Reimplemented from GadgetRepo.
Definition at line 21 of file MediaWikiGadgetsDefinitionRepo.php.
References loadGadgets().
MediaWikiGadgetsDefinitionRepo::getGadgetIds | ( | ) |
Get the ids of the gadgets provided by this repository.
It's possible this could be out of sync with what getGadget() will return due to caching
Reimplemented from GadgetRepo.
Definition at line 30 of file MediaWikiGadgetsDefinitionRepo.php.
References loadGadgets().
MediaWikiGadgetsDefinitionRepo::handlePageUpdate | ( | LinkTarget | $target | ) |
Given that the provided page was updated, invalidate caches if necessary.
LinkTarget | $target |
Reimplemented from GadgetRepo.
Definition at line 39 of file MediaWikiGadgetsDefinitionRepo.php.
References MediaWiki\Linker\LinkTarget\getNamespace(), MediaWiki\Linker\LinkTarget\getText(), and purgeDefinitionCache().
|
private |
Generates a structured list of Gadget objects from a definition.
string | $definition |
Definition at line 157 of file MediaWikiGadgetsDefinitionRepo.php.
References $line, $lines, $section, and newFromDefinition().
Referenced by fetchStructuredList().
|
protected |
Loads list of gadgets and returns it as associative array of sections with gadgets e.g.
[ 'sectionnname1' => [ $gadget1, $gadget2 ], 'sectionnname2' => [ $gadget3 ] ];
Definition at line 64 of file MediaWikiGadgetsDefinitionRepo.php.
References $definitionCache, $value, Gadget\CACHE_TTL, DB_REPLICA, getCheckKey(), and wfGetDB().
Referenced by getGadget(), and getGadgetIds().
MediaWikiGadgetsDefinitionRepo::newFromDefinition | ( | $definition, | |
$category ) |
Creates an instance of this class from definition in MediaWiki:Gadgets-definition.
string | $definition | Gadget definition |
string | $category |
Definition at line 185 of file MediaWikiGadgetsDefinitionRepo.php.
References $options, $params, and Gadget\isValidGadgetID().
Referenced by listFromDefinition().
|
private |
Purge the definitions cache, for example if MediaWiki:Gadgets-definition was edited.
Definition at line 49 of file MediaWikiGadgetsDefinitionRepo.php.
References $cache, and getCheckKey().
Referenced by handlePageUpdate().
|
private |
Definition at line 13 of file MediaWikiGadgetsDefinitionRepo.php.
Referenced by loadGadgets().
const MediaWikiGadgetsDefinitionRepo::CACHE_VERSION = 2 |
Definition at line 11 of file MediaWikiGadgetsDefinitionRepo.php.