Project

General

Profile

Version infrastructure

Virtuemart 1.5

For developers
You can easily update your tables in the updateMigration view in the backend ("yourhost.com/administrator/index.php?option=com_virtuemart&view=updatesMigration). Just use the "restore system defaults"

Virtuemart 1.1.x

General

The VirtueMart Version Updater is handled by a prepared Infrastructure of the following components:

  • class vmUpdate in the VirtueMart Installation
  • Versions Component on virtuemart.net
  • Document Repository on dev.virtuemart.net

Basically the update process is the following:

Update Check + Patch Retrieval

The VirtueMart Installation asks for the latest available (stable) version of VirtueMart.

http://virtuemart.net/index2.php?option=com_versions&catid=1&myVersion={$VMVERSION->RELEASE}&task=latestversionastext

A number like "1.1.5" is returned - just the number as string, nothing else.

If the returned Version is higher than the installed Version, the user is allowed to download the Patch Package when available.

The VirtueMart Installation will ask for the location of the Patch Package:

http://virtuemart.net/index2.php?option=com_versions&catid=1&myVersion={$VMVERSION->RELEASE}&task=listpatchpackages

The Version Component on virtuemart.net must have a new-line separated list of all available Patch Packages in the field "Extra Information:".

Example:

http://dev.virtuemart.net/redmine/attachments/download/XXX/Patch-VirtueMart-1.1.4-1.1.5.zip
http://dev.virtuemart.net/redmine/attachments/download/XXX/Patch-VirtueMart-1.1.3-1.1.5.zip
http://dev.virtuemart.net/redmine/attachments/download/XXX/Patch-VirtueMart-1.1.2-1.1.5.zip

If the Patch Package exists, the URL is returned as pure Text. Example:

http://dev.virtuemart.net/redmine/attachments/download/XXX/Patch-VirtueMart-1.1.4-1.1.5.zip

If no Patch Package exists for the requested Version Update, an empty String is returned.

In the last Step the Document is retrieved from the VirtueMart Document Repository and stored and extracted on the Server the VirtueMart Installation is located on.
Patch Package Manifest

After that the Package is checked for a file called "update.xml". this file must be located in the root of the Patch Package.

@
Here's an example update.xml:

 <?xml version="1.0"?>
 <vmupdate>
    <forversion>1.1.0</forversion>
    <toversion>1.1.3</toversion>
    <releasedate>May 25th 2008</releasedate>
    <description>VirtueMart 1.1.3 Update Package for VirtueMart 1.1.0</description>
    <files>
        <file>administrator/components/com_virtuemart/classes/htmlTools.class.php</file>
        <file>administrator/components/com_virtuemart/global.php</file>
        <file>administrator/components/com_virtuemart/version.php</file>
        <file>components/com_virtuemart/virtuemart.php</file>
        <file>components/com_virtuemart/virtuemart_parser.php</file>
    </files>
    <queries>
        <!-- Trailing Semicolons are not necessary -->
        <!-- Prefix placeholders must be used (#__ or  #__{vm}, not "jos_") -->
        <query>SELECT `id` FROM `jos_components`</query>
    </queries>
 </vmupdate>

@

The Files in the Package are checked:

  • do all exist in the local extraction copy of the Patch Package Archive?
  • are all target files writable?
  • is the target directory writable if the target file doesn't exist?

The Patch Packages should always contain an updated version.php file, so the Version Update is visible afterwards.

Redmine Appliance - Powered by TurnKey Linux