Project

General

Profile

Setting up a Development Environment » History » Version 47

Max Milbers, 04/11/2018 07:30 AM

1 1 Rick Glunt
h1. Setting up a Development Environment
2
3
h2. Introduction
4
5
If you start developing for the project or just with VirtueMart you may have already set up a development environment with an IDE and a SVN program. 
6
7
If you haven't done so or if you want to know what to do better, you can follow the instructions given on this page. 
8
9
The following programs are recommended for working with VirtueMart and synchronizing the working directory with the local SVN repository: 
10
11 16 Max Milbers
* SmartSVN or TortoiseSVN http://tortoisesvn.net/downloads.html
12 42 Max Milbers
* Eclipse for php or aptana (very good PHP IDE and free!). If you can spend some bucks, we suggest to use phpstorm. The whole core team is using this PHP IDE best suitable for joomla. Use the free download http://www.jetbrains.com/phpstorm/download/
13 41 Max Milbers
* Notepad2 for windows as a nice and fast file editor http://www.flos-freeware.ch/notepad2.html
14 1 Rick Glunt
15 46 Max Milbers
Of course there are other programs that can do the same as the ones mentioned above, but remember: these are just recommendations.
16 1 Rick Glunt
17
h2. Setup an IDE and SVN
18
19
If you want to join the project it is important that you have a similar environment like the other devs, so it makes it easier for everyone to help each other. 
20
21 23 Max Milbers
Please use NOT the standard jos_ prefixed, please use something new, here in the exampel we still use jos_. This helps to find hardcoded prefixes. At best is everyone uses another one.
22 1 Rick Glunt
23 46 Max Milbers
You should also install your joomla in a domain with a subdomain and path, for exampel shop.localhost/vm3/. This helps to find path problems.
24 23 Max Milbers
25 15 Oscar van Eijk
Setup up an IDE, I suggest you follow the explanations here: http://docs.joomla.org/Setting_up_your_workstation_for_Joomla!_development 
26 1 Rick Glunt
27 6 Max Milbers
h3. SVN-Basics: 
28 1 Rick Glunt
29 27 Valérie Isaksen
For pure installation information look at the chapter "Installation of virtuemart into your IDE". The SVN folder structure is setup with 3 root folders; trunk, tags and branches. The trunk folder is used for current active development. The tags folder is used for public releases. The branches folder can be used for code branches. 
30 6 Max Milbers
31 1 Rick Glunt
The structure found under these root folders mimic the structure in a typical Joomla installation, however, only contain the VirtueMart code. This gives us the ability to easily commit and checkout directly from a Joomla installation as described above. 
32
33 33 Max Milbers
There are 3 different folders for backend, frontend, modules, and plugins
34 17 Max Milbers
35 1 Rick Glunt
* trunk/virtuemart/administrator/components/com_virtuemart ;pure vm
36 17 Max Milbers
* trunk/virtuemart/administrator/language                  ;mixed
37 23 Max Milbers
* trunk/virtuemart/components/com_virtuemart               ;pure vm
38 17 Max Milbers
* trunk/virtuemart/language                                ;mixed
39 1 Rick Glunt
* trunk/virtuemart/plugins                                 ;mixed
40 33 Max Milbers
* trunk/virtuemart/plugins/vmcustom                        ;pure vm
41 1 Rick Glunt
* trunk/virtuemart/plugins/vmpayment                       ;pure vm
42 36 Valérie Isaksen
* trunk/virtuemart/plugins/vmshipment                      ;pure vm
43 17 Max Milbers
* trunk/virtuemart/modules/                                ;mixed
44 1 Rick Glunt
45
The /trunk is your joomla base root = jRoot. 
46
47
Your best bet is to have a joomla installation already available and make 1 checkout for back and frontend. Use for checkout on the joomla base root: 
48 45 Jörg Kiekebusch
49 46 Max Milbers
for vm3.x.x svn co https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart
50
for vm3.2.x svn co https://dev.virtuemart.net/svn/virtuemart/branches/com_virtuemart.3.0.12.4
51 1 Rick Glunt
52 35 Max Milbers
After updating you should have the newest version of VirtueMart. Use *at best daily the "Install tables or if necessary update them" function* to have an up to date table layout, more explanation here [[Tools]]
53 33 Max Milbers
54 1 Rick Glunt
*Remember:* When you use *j1.5* you must *copy the plugins* from the subfolder manually (weight_countries.php and weight_countries.xml in to the parent direcotry). The reason is that, j1.5 expects the plugins in the folder of the "plugin family" like vmpayment. But j1.7 stores the plugins in the family folder and in its own folder for exampel vmpayment/paypal.
55
56 46 Max Milbers
If you want to check the mails you may want to use hamster as mailserver, otherwise you can just use standard webmail service
57 1 Rick Glunt
58
h2. Installation of virtuemart into your IDE
59
60 46 Max Milbers
Now there were three ways. Be aware that the joomla installation should work.
61 1 Rick Glunt
62 46 Max Milbers
h3. Use the virtuemart fullinstaller
63 47 Max Milbers
64 46 Max Milbers
#Transfer the files in a http directory of your local server (xamp) (example: directory called Joomla)
65
#Browse the folder and your are redirected to the joomla installation process. Follow the installation.
66
#Just use your tortoise svn client on the joomla root folder and do a checkout with the URL given above
67
#Ignore the Warning and overwrite the existing files.
68 47 Max Milbers
#You are ready. Nothing left todo.
69 1 Rick Glunt
70 47 Max Milbers
h3. Old Workarounds (just to complemented the given information, usually not need anylonger).
71 46 Max Milbers
72
My preferred method is at the end, the manual installation! But it needs the use of the "discovery feature in joomla". Before it was nasty, but now it is the prefereed way.
73
74 22 Max Milbers
try this steps:
75 1 Rick Glunt
# Transfer Joomla files in a directory (example: directory called Joomla)
76
# Install Joomla to create the database
77 22 Max Milbers
# Install VM with the installer to install VM tables in the database [[Create virtuemart installer]].
78
# Download also the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files
79
# Checkout VM in an empty directory (You need to call that directory virtuemart to fit the name from SVN directory structure)),
80
# Transfer Joomla files in the directory called virtuemart
81 1 Rick Glunt
# change Joomla configuration file with the database name given on step 2, and give the correct tmp path.
82 22 Max Milbers
83
Advantage: you can use the virtuemart installers
84
Disadvantage: you need to handle two different directory in your http directory and edit the configuration file
85
86 46 Max Milbers
or use them (in case the svn client does not overwrite existing files):
87
This method just needs that you manually delete the virtuemart files after the installation to be able to perform the checkout
88 6 Max Milbers
# This means download or create the installer of virtuemart and install it in joomla [[Create virtuemart installer]]. 
89 1 Rick Glunt
# Download also the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files
90 6 Max Milbers
# Before you can checkout the svn you should delete the files that are installed by the vm installer. Just delete this directories 
91 1 Rick Glunt
* administrator/components/com_virtuemart 
92
* components/com_virtuemart 
93 6 Max Milbers
* plugins/vmpayment
94 1 Rick Glunt
and to prevent warnings the language files named en-GB.com_virtuemart.ini in 
95
* administrator\language 
96 23 Max Milbers
* language
97
4. AFTER that configure the SVN, directly into your joomla base directory.
98
99 22 Max Milbers
Advantage: you can use the virtuemart installers
100
Disadvantage: you need to delete the right files
101
102 23 Max Milbers
h3. Use manual installation and the right sql to inform joomla that virtuemart exists.
103 1 Rick Glunt
and here my preferred method
104 24 Max Milbers
105 22 Max Milbers
# Open your IDE and make a project (call it for exampel vm2)
106 5 Max Milbers
# Set httpd directory to the parent directory (workspace) and best with subdomain like shop.localhost/vm2
107 6 Max Milbers
# Checkout the svn
108 28 Max Milbers
# copy joomla files into "workspace/vm2" , of course just merge the directories, when it is asking. There must be a merge, but no override of files. Note for mac users, use this tool to merge directories http://www.mucommander.com/
109 6 Max Milbers
# Use the right sql to inform joomla that virtuemart exists.
110 40 Max Milbers
# Execute the following sql commands with phpmyadmin. Be aware that these sql assume that you use the prefix jos for your tables. *for joomla 2.5 use the discover feature !!*
111 1 Rick Glunt
112 21 Max Milbers
This is for virtuemart:
113 1 Rick Glunt
with joomla 1.5
114 21 Max Milbers
<pre>
115 1 Rick Glunt
INSERT INTO `jos_components` (`id`, `name`, `link`, `menuid`, `parent`, `admin_menu_link`, `admin_menu_alt`, `option`, `ordering`, `admin_menu_img`, `iscore`, `params`, `enabled`) VALUES
116 25 Max Milbers
(NULL, 'VirtueMart', 'option=com_virtuemart', 0, 0, 'option=com_virtuemart', 'VirtueMart', 'com_virtuemart', 0, '../components/com_virtuemart/assets/images/vmgeneral/menu_icon.png', 0, '', 1);
117 21 Max Milbers
</pre>
118 19 Max Milbers
119 37 Max Milbers
with joomla 1.6/j1.7
120 21 Max Milbers
<pre>
121 1 Rick Glunt
INSERT INTO `jos_extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `custom_data`, `system_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES 
122 32 Max Milbers
(10007, 'virtuemart', 'component', 'com_virtuemart', '', 0, 1, 0, 0, '{"legacy":true,"name":"VirtueMart","type":"component","creationDate":"May 2011","author":"The VirtueMart Development Team","copyright":"\\tCopyright (C) 2011 The Virtuemart Team. All rights reserved.","authorEmail":"team|at|virtuemart.net","authorUrl":"http:\\/\\/www.virtuemart.net","version":"2.0.0","description":"Online-Shop \\/ Complete E-Commerce system for Joomla 1.6","group":""}', '{}', '', '', 0, '0000-00-00 00:00:00', 0, 0);
123 21 Max Milbers
</pre>
124
125
and 
126
<pre>
127
INSERT INTO `jos_menu` (`id`, `menutype`, `title`, `alias`, `note`, `path`, `link`, `type`, `published`, `parent_id`, `level`, `component_id`, `ordering`, `checked_out`, `checked_out_time`, `browserNav`, `access`, `img`, `template_style_id`, `params`, `lft`, `rgt`, `home`, `language`, `client_id`) VALUES 
128
(465, 'main', 'VirtueMart', 'virtuemart', '', 'virtuemart', 'index.php?option=com_virtuemart', 'component', 0, 1, 1, 10007, 0, 0, '0000-00-00 00:00:00', 0, 1, '../components/com_virtuemart/assets/images/vmgeneral/menu_icon.png', 0, '', 277, 278, 0, '', 1);
129
</pre>
130 39 Max Milbers
131
132 29 Max Milbers
133 30 Max Milbers
*after that use "/administrator/index.php?option=com_virtuemart&view=updatesmigration" and choose there "Reset all tables
134
and install sampledata" to install the virtuemart tables.*
135 29 Max Milbers
136 26 Max Milbers
137
138 7 Max Milbers
For information on adding the plugins, please refer to [[Plugin system]].
139 17 Max Milbers
140 18 Max Milbers
For information on adding the modules, please refer to [[Modules system]].