Difference between revisions of "Metadata:Main Page"
From Neocron Wiki
(Created page with " To add soon. :)") |
(Todo) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | == About == | ||
− | To | + | When the Mapping plugin was originally developed, it read the settings from pages within the MediaWiki namespace. However to allow the viewing of the page to work properly, you had to use the .js extension, which isn't ideal. This could easily lead to confusion and the MediaWiki namespace was never really designed for this purpose. |
+ | |||
+ | A new namespace on the THN wiki called MetaData was created and the THN NC Wiki Extensions plugin was re-written to support multiple data types. The type is defined by the extension. Any plugins can access the data from the page via the '''\THN\Wiki\MetaData\Settings''' class. | ||
+ | |||
+ | To keep page and server load times down, all settings are cached in memory by the [http://en.wikipedia.org/wiki/List_of_PHP_accelerators#Alternative_PHP_Cache_.28APC.29 APC] Cache that this wiki has been using for some time now. | ||
+ | |||
+ | == Security == | ||
+ | |||
+ | At this time files in this namespace are only editable and viewable by Bureaucrats. However there are other ways to view the data in this area. Either by the Wiki API or by simply typing ?action=raw at the end of the URL. This is intended by design to stop causal users from browsing the data and settings. | ||
+ | |||
+ | So if you put any data in this section please note:- | ||
+ | |||
+ | * Data is viewable by using the ?action=raw or the Wiki api | ||
+ | * DO NOT put sensitive information in this namespace such as usernames and password or other sensitive setting. | ||
+ | |||
+ | == Debugging and testing settings == | ||
+ | |||
+ | Most supported types allow you to test and debug the settings. This will read the data in and parse it. Use this to make sure what you have typed doesn't break the parser, and it allows you to view the settings as it would be seen by PHP. | ||
+ | |||
+ | You can see the debugger in action by editing the examples, and clicking on the debug button. (Next to the Show changes button) | ||
+ | |||
+ | == Supported types == | ||
+ | |||
+ | These are the current supported types. If a file extension is not recognised, it will default back to wiki text. | ||
+ | |||
+ | === .cfg files === | ||
+ | |||
+ | .cfg files are read in an array for each line. Blank line or comment lines with // are ignored. An example of a .cfg file would be a list of pages or files. | ||
+ | |||
+ | [[Metadata:Examples/Example1.cfg]] | ||
+ | |||
+ | === .prop files === | ||
+ | |||
+ | .prop files are read into an array as key values. Blank line or comment lines with // are ignored. An example of a .prop file would be a set of settings for an extension. | ||
+ | |||
+ | [[Metadata:Examples/Example2.prop]] | ||
+ | |||
+ | === .yaml files === | ||
+ | |||
+ | This is a more complex setting file. Best to read [http://en.wikipedia.org/wiki/YAML YAML] here. Best usage would be to combine several settings files into one, or for more complex data. | ||
+ | |||
+ | The YAML parser used is from [http://symfony.com/doc/master/components/yaml/introduction.html Symfony]. It was intended that the Item DB data was going to be stored in this format in the Wiki. | ||
+ | |||
+ | [[Metadata:Examples/Example3.yaml]] | ||
+ | |||
+ | === .js files === | ||
+ | |||
+ | These are Javascript files. When the page is saved, it is exported to the filesystem, so the web server can access it and serve it. The .js file is also added to the Mediawiki Resource Loader so other extensions can use the file. | ||
+ | |||
+ | [[Metadata:Examples/Example4.js]] | ||
+ | |||
+ | === .css files === | ||
+ | |||
+ | These are CSS files. When the page is saved, it is exported to the filesystem, so the web server can access it and serve it. The .css file is also added to the Mediawiki Resource Loader so other extensions can use the file. | ||
+ | |||
+ | [[Metadata:Examples/Example5.css]] | ||
+ | |||
+ | === .url files === | ||
+ | |||
+ | These files read from extenal URL's, and cache the data for a specified time in seconds. The following lines are required in a .url file | ||
+ | |||
+ | * url: | ||
+ | * timeout: | ||
+ | |||
+ | If a timeout of 0 is specified, the URL is cached forever until the cache is clear out. | ||
+ | |||
+ | [[Metadata:Examples/Example6.url]] | ||
+ | |||
+ | == Todo == | ||
+ | |||
+ | * Write a parser tag to transclude the real output data from the pages. (This would be used on URL pages) | ||
+ | * Write a updated loader to include .css and .js files in all pages from MetaData (As a replacement for [[MediaWiki:Wiki Extension.js]] - for now please continue to use [[MediaWiki:Common.js]] and [[MediaWiki:Common.css]] | ||
+ | * New plugin to dynamically generate parser tags from configuration. This would probably underpin access to the upcoming Items DB V2 from the Wiki. |