![]() ![]() It does not define any behaviour, and is thus purely declarative. The name of the parser hook and the parameters (including their types, default values, etc) itĪccepts. HookDefinitionĪn instance of the HookDefinition class represents the signature of a parser hook. Without needing to do any parsing, validation, defaulting, etc. That takes an array of positive integers? Your handler will always get an actual PHP array of integer The parser function is, or how the parameters for it should be processed. That the handler you write for your parser function will not need to care about what the name of Specified in this definition to do parameter processing via the ParamProcessor library. Your parser hooks and the handlers for them separately. The declarative OOP interface provided by this library allows you to define the signatures of Load all dependencies and the load the ParserHooks library by including its entry point:Īll classes are located in the ParserHooks namespace, which is PSR-0 mapped onto the src/ directory. You can find a list of the dependencies in the "require" section of the composer.json file. Get the ParserHooks code, either via git, or some other means. Here is a minimal example of a composer.json file that just defines a dependency on To add this package as a local, per-project dependency to your project, simply add aĭependency on mediawiki/parser-hooks to your project's composer.json file. The git repository and take care of loading yourself. This package as well as its dependencies. You can use Composer to download and install For a detailed list of changes, see the release notes. Minimum requirements are indicated in bold. Work with more recent versions of PHP and MediaWiki, though this is not guaranteed. The PHP and MediaWiki version ranges listed are those in which ParserHooks is known to work. Platform compatibility and release status It does not in itself add or enhance functionality of your wiki. This is a PHP library for MediaWiki extensions. OOP interface for creating MediaWiki parser hooks in a declarative fashion. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |