Project

General

Profile

Version infrastructure » History » Version 1

Max Milbers, 04/19/2010 11:59 AM

1 1 Max Milbers
h1. Version infrastructure
2
3
h2. Virtuemart 1.5
4
5
h2. Virtuemart 1.1.x
6
7
h3. General
8
9
The VirtueMart Version Updater is handled by a prepared Infrastructure of the following components:
10
 
11
    * class vmUpdate in the VirtueMart Installation
12
    * Versions Component on virtuemart.net
13
    * Document Repository on dev.virtuemart.net 
14
15
Basically the update process is the following:
16
17
Update Check + Patch Retrieval
18
19
The VirtueMart Installation asks for the latest available (stable) version of VirtueMart.
20
21
http://virtuemart.net/index2.php?option=com_versions&catid=1&myVersion={$VMVERSION->RELEASE}&task=latestversionastext 
22
23
A number like "1.1.3" is returned - just the number as string, nothing else.
24
25
If the returned Version is higher than the installed Version, the user is allowed to download the Patch Package when available.
26
27
The VirtueMart Installation will ask for the location of the Patch Package:
28
29
http://virtuemart.net/index2.php?option=com_versions&catid=1&myVersion={$VMVERSION->RELEASE}&task=listpatchpackages 
30
31
The Version Component on virtuemart.net must have a new-line separated list of all available Patch Packages in the field "Extra Information:".
32
33
Example:
34
35
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.0_TO_VirtueMart-1.1.3.tar.gz?doc_id=xx
36
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.1_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxx
37
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxxx
38
39
If the Patch Package exists, the URL is returned as pure Text. Example:
40
41
http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=XXX
42
43
If no Patch Package exists for the requested Version Update, an empty String is returned.
44
45
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.
46
Patch Package Manifest
47
48
After that the Package is checked for a file called "update.xml". this file must be located in the root of the Patch Package.
49
50
@
51
Here's an example update.xml:
52
53
 <?xml version="1.0"?>
54
 <vmupdate>
55
    <forversion>1.1.0</forversion>
56
    <toversion>1.1.3</toversion>
57
    <releasedate>May 25th 2008</releasedate>
58
    <description>VirtueMart 1.1.3 Update Package for VirtueMart 1.1.0</description>
59
    <files>
60
        <file>administrator/components/com_virtuemart/classes/htmlTools.class.php</file>
61
        <file>administrator/components/com_virtuemart/global.php</file>
62
        <file>administrator/components/com_virtuemart/version.php</file>
63
        <file>components/com_virtuemart/virtuemart.php</file>
64
        <file>components/com_virtuemart/virtuemart_parser.php</file>
65
    </files>
66
    <queries>
67
        <!-- Trailing Semicolons are not necessary -->
68
        <!-- Prefix placeholders must be used (#__ or  #__{vm}, not "jos_") -->
69
        <query>SELECT `id` FROM `jos_components`</query>
70
    </queries>
71
 </vmupdate>
72
@
73
74
The Files in the Package are checked:
75
76
    * do all exist in the local extraction copy of the Patch Package Archive?
77
    * are all target files writable?
78
    * is the target directory writable if the target file doesn't exist? 
79
80
The Patch Packages should always contain an updated version.php file, so the Version Update is visible afterwards.