Setting up a Development Environment » History » Version 35
Max Milbers, 10/17/2011 09:43 PM
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 | * Eclipse for php or aptana (very good PHP IDE and free!) |
||
13 | 1 | Rick Glunt | |
14 | 12 | Max Milbers | Of course there are other programs that can do the same as the ones mentioned above, but remember: these are just recommendations. You need in everycase jdump installed. |
15 | 1 | Rick Glunt | |
16 | h2. Setup an IDE and SVN |
||
17 | |||
18 | 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. |
||
19 | |||
20 | 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. |
21 | 1 | Rick Glunt | |
22 | 23 | Max Milbers | You should also install your joomla in a domain with a subdomain and path, for exampel shop.localhost/vm2/. This helps to find path problems. |
23 | |||
24 | Setup up an IDE, I suggest you follow the explanations here: http://docs.joomla.org/Setting_up_your_workstation_for_Joomla!_development |
||
25 | |||
26 | 15 | Oscar van Eijk | For development and testing we use JDump (http://extensions.joomla.org/extensions/miscellaneous/development/1509). In official releases (beta, RC and, of course, final), all dump() calls are removed or outcommented, but for SVN checkouts of development releases this extension is required. |
27 | 1 | Rick Glunt | |
28 | 6 | Max Milbers | h3. SVN-Basics: |
29 | 1 | Rick Glunt | |
30 | 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. |
31 | 6 | Max Milbers | |
32 | 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. |
33 | |||
34 | 33 | Max Milbers | There are 3 different folders for backend, frontend, modules, and plugins |
35 | 17 | Max Milbers | |
36 | 1 | Rick Glunt | * trunk/virtuemart/administrator/components/com_virtuemart ;pure vm |
37 | 17 | Max Milbers | * trunk/virtuemart/administrator/language ;mixed |
38 | 23 | Max Milbers | * trunk/virtuemart/components/com_virtuemart ;pure vm |
39 | 17 | Max Milbers | * trunk/virtuemart/language ;mixed |
40 | 1 | Rick Glunt | * trunk/virtuemart/plugins ;mixed |
41 | 33 | Max Milbers | * trunk/virtuemart/plugins/vmcustom ;pure vm |
42 | 1 | Rick Glunt | * trunk/virtuemart/plugins/vmpayment ;pure vm |
43 | 33 | Max Milbers | * trunk/virtuemart/plugins/vmshipper ;pure vm |
44 | 17 | Max Milbers | * trunk/virtuemart/modules/ ;mixed |
45 | 1 | Rick Glunt | |
46 | The /trunk is your joomla base root = jRoot. |
||
47 | |||
48 | 6 | Max Milbers | At best is if you have a joomla installation and make 1 checkout for back and frontend. Use for checkout on the joomla base root: |
49 | 2 | Rick Glunt | |
50 | 1 | Rick Glunt | svn co https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart |
51 | |||
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 | *Remember:* When you use *j1.7* you must *copy the plugins* into the right subfolder manually (weight_countries.php and weight_countries.xml in to a subfolder weight_countries). 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 | But j1.7 the plugins are stored in the family folder and in its own folder. for exampel vmpayment/paypal. |
||
57 | 1 | Rick Glunt | |
58 | If you want to check the mails you may want to use hamster as mailserver |
||
59 | |||
60 | h2. Installation of virtuemart into your IDE |
||
61 | 6 | Max Milbers | |
62 | Now there are three ways. Be aware that the joomla installation should work. |
||
63 | 1 | Rick Glunt | |
64 | h3. Use the virtuemart installer to set the right entries for using virtuemart. |
||
65 | |||
66 | 23 | Max Milbers | My preferred method is at the end, the manual installation! But it needs manual executing of sql (provided though). So when you want to avoid phpmyadmin, try one of the first two ways. |
67 | 22 | Max Milbers | |
68 | 23 | Max Milbers | try this steps: |
69 | 22 | Max Milbers | # Transfer Joomla files in a directory (example: directory called Joomla) |
70 | # Install Joomla to create the database |
||
71 | # Install VM with the installer to install VM tables in the database [[Create virtuemart installer]]. |
||
72 | # Download also the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files |
||
73 | # Checkout VM in an empty directory (You need to call that directory virtuemart to fit the name from SVN directory structure)), |
||
74 | # Transfer Joomla files in the directory called virtuemart |
||
75 | 1 | Rick Glunt | # change Joomla configuration file with the database name given on step 2, and give the correct tmp path. |
76 | 22 | Max Milbers | |
77 | Advantage: you can use the virtuemart installers |
||
78 | Disadvantage: you need to handle two different directory in your http directory and edit the configuration file |
||
79 | |||
80 | 23 | Max Milbers | or use them: |
81 | 22 | Max Milbers | This method just needs that you manually delete the virtuemart files after the installation to be able to perform the checkout (most svn clients dont overwrite existing files). |
82 | 6 | Max Milbers | # This means download or create the installer of virtuemart and install it in joomla [[Create virtuemart installer]]. |
83 | 1 | Rick Glunt | # Download also the all-in-one payment plugin installer at http://dev.virtuemart.net/projects/virtuemart/files |
84 | 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 |
85 | 1 | Rick Glunt | * administrator/components/com_virtuemart |
86 | * components/com_virtuemart |
||
87 | 6 | Max Milbers | * plugins/vmpayment |
88 | 1 | Rick Glunt | and to prevent warnings the language files named en-GB.com_virtuemart.ini in |
89 | * administrator\language |
||
90 | 23 | Max Milbers | * language |
91 | 4. AFTER that configure the SVN, directly into your joomla base directory. |
||
92 | |||
93 | 22 | Max Milbers | Advantage: you can use the virtuemart installers |
94 | Disadvantage: you need to delete the right files |
||
95 | |||
96 | 23 | Max Milbers | h3. Use manual installation and the right sql to inform joomla that virtuemart exists. |
97 | 1 | Rick Glunt | and here my preferred method |
98 | 24 | Max Milbers | |
99 | 22 | Max Milbers | # Open your IDE and make a project (call it for exampel vm2) |
100 | 5 | Max Milbers | # Set httpd directory to the parent directory (workspace) and best with subdomain like shop.localhost/vm2 |
101 | 6 | Max Milbers | # Checkout the svn |
102 | 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/ |
103 | 6 | Max Milbers | # Use the right sql to inform joomla that virtuemart exists. |
104 | 23 | Max Milbers | # Execute the following sql commands with phpmyadmin. Be aware that these sql assume that you use the prefix jos for your tables. |
105 | 1 | Rick Glunt | |
106 | 21 | Max Milbers | This is for virtuemart: |
107 | 1 | Rick Glunt | with joomla 1.5 |
108 | 21 | Max Milbers | <pre> |
109 | 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 |
110 | 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); |
111 | 21 | Max Milbers | </pre> |
112 | 19 | Max Milbers | |
113 | 1 | Rick Glunt | with joomla 1.6 |
114 | 21 | Max Milbers | <pre> |
115 | 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 |
116 | 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); |
117 | 21 | Max Milbers | </pre> |
118 | |||
119 | and |
||
120 | <pre> |
||
121 | 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 |
||
122 | (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); |
||
123 | </pre> |
||
124 | 1 | Rick Glunt | |
125 | 29 | Max Milbers | |
126 | 30 | Max Milbers | *after that use "/administrator/index.php?option=com_virtuemart&view=updatesmigration" and choose there "Reset all tables |
127 | and install sampledata" to install the virtuemart tables.* |
||
128 | 29 | Max Milbers | |
129 | 26 | Max Milbers | |
130 | |||
131 | 7 | Max Milbers | For information on adding the plugins, please refer to [[Plugin system]]. |
132 | 17 | Max Milbers | |
133 | 18 | Max Milbers | For information on adding the modules, please refer to [[Modules system]]. |