| ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| Developer Guidelines |
| Tags: No tags associated yet. | All Tags... |
Please use the date, your SVN username and the following characters to indicate a modification:
An example entry could like like this:
06-09-2006 soeren_nb ^ changed this and that # fixed bug no. 75 [Bug desription] + added feature from request no. 56 [feature description]Please keep your descriptions as readable as possible. A lot of people are following the changes and are interested in understanding all changes and their consequences. If you had to make a change to the database schema, please indicate those changes with extra emphasis.
Because you’re not the only one working on a development version, please add all queries which are necessary to update a database to comply with your changes.
^ ## Database structure changed ##
ALTER TABLE mos_pshop_order_user_info ADD `extra_field_1` varchar(255) default NULL;
Please read the section "Database" for all notes about the database and its scheme.
MySQL version compatibility As there is no "real" database abstraction in Joomla!, we keep compatibility to MySQL. All SQL queries must be compatible with at least MySQL version 4.0.
Joomla! Version Compatibility
VirtueMart will keep track with the Joomla! development.
/**
* Short description for file
*
* Long description for file (if any)...
*
*
* @package VirtueMart
* @subpackage classes_product
* @author Original Author
* @author Another Author
* @copyright 2008 VirtueMart Development Team
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @version $Id:$
*/
/*
* Place includes, constant defines and $_GLOBAL settings here.
* Make sure they have appropriate docblocks to avoid phpDocumentor
* construing they are documented by the page-level docblock.
*/
/**
* Short description for class
*
* Long description for class (if any)...
*
* @author Original Author
* @author Another Author
* @copyright 2008 VirtueMart Development Team
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @version Release:
*/
class foo {
/** @var database Internal database class pointer */
var $_db=null;
/** @var object An object of configuration variables */
var $_config=null;
/** @var object An object of path variables */
var $_path=null;
/** @var mosSession The current session */
var $_session=null;
/** @var string The current template */
var $_template=null;
/** @var array An array to hold global user state within a session */
/**
* This function does something special.
* @param string The name of the product
* @param int The ID of the product
* @return string HTML Table with a "snapshot" of the product
*/
function myFunction( $arg1, &$arg2 ) {
if( $that ) {
doThis(); \\ }
}
}
?>
Short Descriptions
Short descriptions must be provided for all docblocks. They should be a quick sentence, not the name of the item, but the description of the „what does this file / class?“.
@license
VirtueMart is released under the GNU/GPL license. You should keep this license for best compatibility.
There’s no hard rule to determine when a new code contributor should be added to the list of authors for a given source file. In general, their changes should fall into the “substantial” category (meaning somewhere around 10% to 20% of code changes). Exceptions could be made for rewriting functions or contributing new logic.
Simple code reorganization or bug fixes would not justify the addition of a new individual to the list of authors.
Optional Tags
@copyright
Feel free to apply whatever copyrights you desire. When formatting this tag, the year should be in four digit format and if a span of years is involved, use a hyphen between the earliest and latest year. The copyright holder can be you, a list of people, a company, the PHP Group, etc. Examples:
To ease long term readability of source code, the text and tags must conform to the order and spacing provided in the example above. This standard is adopted from the JavaDoc standard.
Read more about how to obtain the VirtueMart source code and build the installer.
VirtueMart manages its documentation in the DocBook format. You can checkout the sources in the DocBook format and transform the DocBook source using an XSL Transformer into PDF, HTML, CHM or whatever else...
The documentation source can be obtained by checking out the trunk from the SVN repository (see first section on this page).
The best software to modify DocBook sources is the XML Mind XML Editor. After you have downloaded and installed the software you can just open the main documentation file and start working on it:
Changes to the main db schema require a that an upgrade patch is posted as well. Your change will be backed out if you don’t provide a patch as well.
First of all you need to make an entry in the Changelog, including the SQL Queries to update a database scheme.
All changes to the database scheme are collected in an SQL file. There’s a file for each minor version jump, e.g.
UPDATE-SCRIPT_com_virtuemart_1.1.0-to-1.2.0.sql
The file can be found in the subdirectory /sql.
A user must see which version of VirtueMart this SQL patch file applies to and to which version it updates the db scheme.
In this case the SQL file would update a db scheme from version 1.1.0 to 1.2.0.