Project

General

Profile

Actions

Version infrastructure » History » Revision 1

Revision 1/3 | Next »
Max Milbers, 04/19/2010 11:59 AM


Version infrastructure

Virtuemart 1.5

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.3" 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/cb/displayDocument/Patch_VirtueMart-1.1.0_TO_VirtueMart-1.1.3.tar.gz?doc_id=xx
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.1_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxx
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxxx

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

http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=XXX

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"?>
&lt;vmupdate&gt;
&lt;forversion&gt;1.1.0&lt;/forversion&gt;
&lt;toversion&gt;1.1.3&lt;/toversion&gt;
&lt;releasedate&gt;May 25th 2008&lt;/releasedate&gt;
&lt;description&gt;VirtueMart 1.1.3 Update Package for VirtueMart 1.1.0&lt;/description&gt;
&lt;files&gt;
&lt;file&gt;administrator/components/com_virtuemart/classes/htmlTools.class.php&lt;/file&gt;
&lt;file&gt;administrator/components/com_virtuemart/global.php&lt;/file&gt;
&lt;file&gt;administrator/components/com_virtuemart/version.php&lt;/file&gt;
&lt;file&gt;components/com_virtuemart/virtuemart.php&lt;/file&gt;
&lt;file&gt;components/com_virtuemart/virtuemart_parser.php&lt;/file&gt;
&lt;/files&gt;
&lt;queries&gt;


&lt;query&gt;SELECT `id` FROM `jos_components`&lt;/query&gt;
&lt;/queries&gt;
&lt;/vmupdate&gt;
@

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.

Updated by Max Milbers over 14 years ago · 1 revisions