Version infrastructure » History » Revision 2
Revision 1 (Max Milbers, 04/19/2010 11:59 AM) → Revision 2/3 (Max Milbers, 04/19/2010 12:02 PM)
h1. Version infrastructure
h2. Virtuemart 1.5
h3. For developers
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"
h2. Virtuemart 1.1.x
h3. 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"?>
<vmupdate>
<forversion>1.1.0</forversion>
<toversion>1.1.3</toversion>
<releasedate>May 25th 2008</releasedate>
<description>VirtueMart 1.1.3 Update Package for VirtueMart 1.1.0</description>
<files>
<file>administrator/components/com_virtuemart/classes/htmlTools.class.php</file>
<file>administrator/components/com_virtuemart/global.php</file>
<file>administrator/components/com_virtuemart/version.php</file>
<file>components/com_virtuemart/virtuemart.php</file>
<file>components/com_virtuemart/virtuemart_parser.php</file>
</files>
<queries>
<!-- Trailing Semicolons are not necessary -->
<!-- Prefix placeholders must be used (#__ or #__{vm}, not "jos_") -->
<query>SELECT `id` FROM `jos_components`</query>
</queries>
</vmupdate>
@
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.