Project

General

Profile

Version infrastructure » History » Version 3

Sören Eberhardt-Biermann, 08/20/2010 03:21 AM

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