MediaWiki REL1_31
|
GadgetRepo implementation where each gadget has a page in the Gadget definition namespace, and scripts and styles are located in the Gadget namespace. More...
Public Member Functions | |
__construct () | |
getGadget ( $id) | |
getGadgetIds () | |
Get a list of gadget ids from cache/database. | |
handlePageCreation (LinkTarget $target) | |
@inheritDoc | |
handlePageDeletion (LinkTarget $target) | |
@inheritDoc | |
handlePageUpdate (LinkTarget $target) | |
@inheritDoc | |
purgeGadgetEntry ( $id) | |
Update the cache for a specific Gadget whenever it is updated. | |
purgeGadgetIdsList () | |
Purge the list of gadget ids when a page is deleted or if a new page is created. | |
Public Member Functions inherited from GadgetRepo | |
getStructuredList () | |
Get a list of gadgets sorted by category. | |
Public Attributes | |
const | CACHE_TTL = 86400 |
How long in seconds the list of gadget ids and individual gadgets should be cached for (1 day) | |
Private Member Functions | |
getGadgetCacheKey ( $id) | |
getGadgetIdsKey () | |
Private Attributes | |
WANObjectCache | $wanCache |
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. | |
GadgetRepo implementation where each gadget has a page in the Gadget definition namespace, and scripts and styles are located in the Gadget namespace.
Definition at line 12 of file GadgetDefinitionNamespaceRepo.php.
GadgetDefinitionNamespaceRepo::__construct | ( | ) |
Definition at line 24 of file GadgetDefinitionNamespaceRepo.php.
GadgetDefinitionNamespaceRepo::getGadget | ( | $id | ) |
string | $id |
InvalidArgumentException |
Reimplemented from GadgetRepo.
Definition at line 98 of file GadgetDefinitionNamespaceRepo.php.
References $rev, DB_REPLICA, getGadgetCacheKey(), Gadget\newFromDefinitionContent(), and wfGetDB().
|
private |
string | $id |
Definition at line 163 of file GadgetDefinitionNamespaceRepo.php.
References Gadget\GADGET_CLASS_VERSION.
Referenced by getGadget(), and purgeGadgetEntry().
GadgetDefinitionNamespaceRepo::getGadgetIds | ( | ) |
Get a list of gadget ids from cache/database.
Reimplemented from GadgetRepo.
Definition at line 33 of file GadgetDefinitionNamespaceRepo.php.
References $dbr, DB_REPLICA, getGadgetIdsKey(), and wfGetDB().
|
private |
Definition at line 155 of file GadgetDefinitionNamespaceRepo.php.
Referenced by getGadgetIds(), and purgeGadgetIdsList().
GadgetDefinitionNamespaceRepo::handlePageCreation | ( | LinkTarget | $target | ) |
@inheritDoc
Reimplemented from GadgetRepo.
Definition at line 70 of file GadgetDefinitionNamespaceRepo.php.
References MediaWiki\Linker\LinkTarget\inNamespace(), and purgeGadgetIdsList().
GadgetDefinitionNamespaceRepo::handlePageDeletion | ( | LinkTarget | $target | ) |
@inheritDoc
Reimplemented from GadgetRepo.
Definition at line 79 of file GadgetDefinitionNamespaceRepo.php.
References MediaWiki\Linker\LinkTarget\getText(), MediaWiki\Linker\LinkTarget\inNamespace(), purgeGadgetEntry(), and purgeGadgetIdsList().
GadgetDefinitionNamespaceRepo::handlePageUpdate | ( | LinkTarget | $target | ) |
@inheritDoc
Reimplemented from GadgetRepo.
Definition at line 61 of file GadgetDefinitionNamespaceRepo.php.
References MediaWiki\Linker\LinkTarget\getText(), MediaWiki\Linker\LinkTarget\inNamespace(), and purgeGadgetEntry().
GadgetDefinitionNamespaceRepo::purgeGadgetEntry | ( | $id | ) |
Update the cache for a specific Gadget whenever it is updated.
string | $id |
Definition at line 148 of file GadgetDefinitionNamespaceRepo.php.
References getGadgetCacheKey().
Referenced by handlePageDeletion(), and handlePageUpdate().
GadgetDefinitionNamespaceRepo::purgeGadgetIdsList | ( | ) |
Purge the list of gadget ids when a page is deleted or if a new page is created.
Definition at line 89 of file GadgetDefinitionNamespaceRepo.php.
References getGadgetIdsKey().
Referenced by handlePageCreation(), and handlePageDeletion().
|
private |
Definition at line 22 of file GadgetDefinitionNamespaceRepo.php.
const GadgetDefinitionNamespaceRepo::CACHE_TTL = 86400 |
How long in seconds the list of gadget ids and individual gadgets should be cached for (1 day)
Definition at line 17 of file GadgetDefinitionNamespaceRepo.php.