MediaWiki
REL1_24
|
Factory class to create Skin objects. More...
Public Member Functions | |
getSkinNames () | |
Returns an associative array of: skin name => human readable name. | |
makeSkin ($name) | |
Create a given Skin using the registered callback for $name. | |
register ($name, $displayName, $callback) | |
Register a new Skin factory function. | |
Static Public Member Functions | |
static | getDefaultInstance () |
Private Member Functions | |
getLegacySkin ($name) | |
Get a legacy skin which uses the autodiscovery mechanism. | |
getLegacySkinNames () | |
Private Attributes | |
array | $displayNames = array() |
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available. | |
array | $factoryFunctions = array() |
Map of name => callback. | |
array | $legacySkins = array() |
Map of name => class name without "Skin" prefix, for legacy skins using the autodiscovery mechanism. | |
Static Private Attributes | |
static | $self |
static SkinFactory::getDefaultInstance | ( | ) | [static] |
Definition at line 53 of file SkinFactory.php.
Referenced by SkinFallbackTemplate\buildHelpfulInformationMessage(), Skin\getSkinNames(), Skin\newFromKey(), ResourceLoaderModuleTest\setUp(), and OutputPageTest\testMakeResourceLoaderLink().
SkinFactory::getLegacySkin | ( | $ | name | ) | [private] |
Get a legacy skin which uses the autodiscovery mechanism.
string | $name |
Definition at line 161 of file SkinFactory.php.
SkinFactory::getLegacySkinNames | ( | ) | [private] |
Definition at line 85 of file SkinFactory.php.
Returns an associative array of: skin name => human readable name.
Definition at line 148 of file SkinFactory.php.
SkinFactory::makeSkin | ( | $ | name | ) |
Create a given Skin using the registered callback for $name.
string | $name | Name of the skin you want |
SkinException | If a factory function isn't registered for $name |
UnexpectedValueException | If the factory function returns a non-Skin object |
Definition at line 195 of file SkinFactory.php.
SkinFactory::register | ( | $ | name, |
$ | displayName, | ||
$ | callback | ||
) |
Register a new Skin factory function.
Will override if it's already registered.
string | $name | Internal skin name. Should be all-lowercase (technically doesn't have to be, but doing so would change the case of i18n message keys). |
string | $displayName | For backwards-compatibility with old skin loading system. This is the text used as skin's human-readable name when the 'skinname-<skin>' message is not available. It should be the same as the skin name provided in $wgExtensionCredits. |
callable | $callback | Callback that takes the skin name as an argument |
InvalidArgumentException | If an invalid callback is provided |
Definition at line 74 of file SkinFactory.php.
Map of name => fallback human-readable name, used when the 'skinname-<skin>' message is not available.
Definition at line 40 of file SkinFactory.php.
Map of name => callback.
Definition at line 34 of file SkinFactory.php.
Map of name => class name without "Skin" prefix, for legacy skins using the autodiscovery mechanism.
Definition at line 46 of file SkinFactory.php.
SkinFactory::$self [static, private] |
Definition at line 51 of file SkinFactory.php.