Latest Neocron News and Information

  • New test server patch #550 has been released to Vedeena
  • New retail server patch #551 has been released to Titan

Difference between revisions of "Metadata:Main Page"

From Neocron Wiki
Jump to: navigation, search
(Intro)
(Todo)
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
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.
 
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.
+
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 ==
 
== Security ==
Line 15: Line 15:
 
* Data is viewable by using the ?action=raw or the Wiki api
 
* 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.
 
* 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 ==
 
== Supported types ==
Line 21: Line 27:
  
 
=== .cfg files ===
 
=== .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 ===
 +
 +
.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 ===
 
=== .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 ===
 
=== .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 ===
 
=== .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 ===
 
=== .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.

Latest revision as of 17:43, 27 May 2013

Sorry you do not have permissions to view this page.