Version infrastructure » History » Version 2
Max Milbers, 04/19/2010 12:02 PM
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 | A number like "1.1.3" is returned - just the number as string, nothing else. |
||
27 | |||
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 | |||
38 | http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.0_TO_VirtueMart-1.1.3.tar.gz?doc_id=xx |
||
39 | http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.1_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxx |
||
40 | http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=xxxx |
||
41 | |||
42 | If the Patch Package exists, the URL is returned as pure Text. Example: |
||
43 | |||
44 | http://dev.virtuemart.net/cb/displayDocument/Patch_VirtueMart-1.1.2_TO_VirtueMart-1.1.3.tar.gz?doc_id=XXX |
||
45 | |||
46 | If no Patch Package exists for the requested Version Update, an empty String is returned. |
||
47 | |||
48 | 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. |
||
49 | Patch Package Manifest |
||
50 | |||
51 | After that the Package is checked for a file called "update.xml". this file must be located in the root of the Patch Package. |
||
52 | |||
53 | @ |
||
54 | Here's an example update.xml: |
||
55 | |||
56 | <?xml version="1.0"?> |
||
57 | <vmupdate> |
||
58 | <forversion>1.1.0</forversion> |
||
59 | <toversion>1.1.3</toversion> |
||
60 | <releasedate>May 25th 2008</releasedate> |
||
61 | <description>VirtueMart 1.1.3 Update Package for VirtueMart 1.1.0</description> |
||
62 | <files> |
||
63 | <file>administrator/components/com_virtuemart/classes/htmlTools.class.php</file> |
||
64 | <file>administrator/components/com_virtuemart/global.php</file> |
||
65 | <file>administrator/components/com_virtuemart/version.php</file> |
||
66 | <file>components/com_virtuemart/virtuemart.php</file> |
||
67 | <file>components/com_virtuemart/virtuemart_parser.php</file> |
||
68 | </files> |
||
69 | <queries> |
||
70 | <!-- Trailing Semicolons are not necessary --> |
||
71 | <!-- Prefix placeholders must be used (#__ or #__{vm}, not "jos_") --> |
||
72 | <query>SELECT `id` FROM `jos_components`</query> |
||
73 | </queries> |
||
74 | </vmupdate> |
||
75 | @ |
||
76 | |||
77 | The Files in the Package are checked: |
||
78 | |||
79 | * do all exist in the local extraction copy of the Patch Package Archive? |
||
80 | * are all target files writable? |
||
81 | * is the target directory writable if the target file doesn't exist? |
||
82 | |||
83 | The Patch Packages should always contain an updated version.php file, so the Version Update is visible afterwards. |