Project

General

Profile

Version infrastructure » History » Version 1

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

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