Virtual Addons
From MemHT Wiki
Contents |
Starting from the 3.8.1 version, Virtual Addons can be installed from XML installer files.
Those XML files are universal and in the future will be usable to install other components too (blocks for example). The same file can be used to update the installed component, locally or in remote (url indicated in the "updatefrom" field).
XML installer file structure
<?xml version="1.0" encoding="utf-8"?> <source engine="1.0"> <component opt="type">addon</component> <component opt="name">example</component> <component opt="title">Example</component> <component opt="version">100</component> <component opt="description">Description</component> <component opt="updatefrom">http://www.example.com/path/example.xml</component> <instructions opt="install">Installation instructions</instructions> <instructions opt="update">Update instructions</instructions> <code opt="install"> <![CDATA[ ]]> </code> <code opt="update"> <![CDATA[ ]]> </code> <code opt="content"> <![CDATA[]]> </code> < /source>
Components
<component opt="type">addon</component>
For the moment this tag should not be modified. In the future it will be used to indicate the component type (addon,block etc) Required
<component opt="name">example</component>
This is the addon unique name. As for standard addons, it must be unique, low caps and cannot contain any special character nor spaces. Required
<component opt="title">Example</component>
Addon title. Just use your fantasy. Required
<component opt="version">100</component>
Script version. It must be in a numeric format, no other characters are accepted. Optional
<component opt="description">Description</component>
Short addon description. Optional
<component opt="updatefrom">http://www.example.com/path/example.xml</component>
Within this tag, a remote XML installer file, used to update the addon in the future can be indicated. Optional
<instructions opt="install">Installation instructions</instructions> <instructions opt="update">Update instructions</instructions>
Write here any instructions that users should read when installing or updating the addon. Example: CHMOD the folder xx, Do this, Do not do this etc.. The message is shown before the installation or the update is finished. Optional
<code opt="install"> <![CDATA[ ]]> </code> <code opt="update"> <![CDATA[ ]]> </code>
Within code install and update tags, you can put the PHP code that have to be executed during the installation or the update of the addon. For example, when installing an addon you could need to create database tables, chmod folders, create files etc. During the updating process you could need to modify a database table because the code is changed etc. IMPORTANT: PHP source code must be placed within the CDATA tag, DO NOT remove it. Optional
<code opt="content"> <![CDATA[ ]]> </code>
Here (finally) goes the addon PHP source code. Remember to place it withing the CDATA tag. Required
Working example
| Languages | العربية • Bahasa Indonesia • Bosanski • Български • Dansk • Deutsch • English • Español • فارسی • Français • Galego • עברית • Italiano • Magyar • Македонски • Nederlands • Português • Русский • Српски/Srpski • Svenska • Türkçe • Українська • Tiếng Việt |
