Accessing the source code: Difference between revisions
From LimeSurvey Manual
No edit summary |
No edit summary |
||
Line 37: | Line 37: | ||
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev | +svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev | ||
# For LimeSurvey 1.x with ExpressionManager (unstable, including newer features): | # For LimeSurvey 1.x with ExpressionManager (unstable, including newer features): | ||
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev_tms | +svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev_tms | ||
# For LimeSurvey 2.x yii development source ( future 2.X) (unstable, including newer features): | |||
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_yii | |||
# <nowiki>[deprecated]</nowiki> For LimeSurvey 1.x ci development source ( future 2.X) (unstable, including newer features): | |||
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_ci | |||
# Once the checkout is complete there will be a folder named 'limsurvey' (or dir_name) in your current terminal working directory containing the source. | # Once the checkout is complete there will be a folder named 'limsurvey' (or dir_name) in your current terminal working directory containing the source. | ||
Revision as of 13:45, 26 November 2011
Accessing the LimeSurvey v1/v2 Source Code
Always be aware that LimeSurvey Source code is bleeding edge. Do not use it for production purposes!
As for many other free software projects only community support is available.
Access the LimeSurvey source code with a Subversion client for your operating system.
- For Windows we recommend: TortoiseSVN. TortoiseSVN integrates nicely with explorer and is very easy to use.
- For Mac we recommend: subversion. Commandline all the way ;)
Step-by-Step How-To (Windows)
- Download and install TortoiseSVN. Reboot after install.
- Create a destination directory for the source
- Change to that directory
- Right-click into the directory and choose 'SVN Checkout'
- You'll be prompted for the repository URL. Enter the following URL:
- For LimeSurvey 1.x latest stable source (including fixes): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey
- For LimeSurvey 1.x latest development source (unstable, including newer features): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev
- [deprecated] For LimeSurvey CI source: https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_ci
- For LimeSurvey 1.x with ExpressionManager (unstable, including newer features): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev_tms
- For LimeSurvey Yii source (LimeSurvey 2.x): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_yii
- That's it. The source code should be downloading now.
Step-by-Step How-To (Mac, Linux, Unix)
- Download and install subversion.
- From a terminal window navigate to a directory that you would like to checkout the code to
- Type one of the following into the terminal:
+For LimeSurvey 1.x source:
- For LimeSurvey 1.x latest stable source (including fixes):
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey
- For LimeSurvey 1.x latest development source (unstable, including newer features):
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev
- For LimeSurvey 1.x with ExpressionManager (unstable, including newer features):
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev_tms
- For LimeSurvey 2.x yii development source ( future 2.X) (unstable, including newer features):
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_yii
- [deprecated] For LimeSurvey 1.x ci development source ( future 2.X) (unstable, including newer features):
+svn co https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_ci
- Once the checkout is complete there will be a folder named 'limsurvey' (or dir_name) in your current terminal working directory containing the source.
Accessing Old Releases
Old releases are stored in https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/releases .
Important files
If you want to get familiar with Limesurvey code these are the most important files:
Root folder
Configuration files:
- config.php
- config-ldap.php
- config-defaults.php
Survey core files:
- common.php: common functions used in 'survey at runtime' code and in 'admin gui code'
- ldap-functions.php: common functions for ldap connector (currently only used in import tokens)
- qanda.php: functions handling questions (display, ...)
- question.php: code handling '1 question per page' kind of survey
- group.php: code handling '1 group per page' kind of survey
- survey.php: code handling 'All in one page' kind of survey
- register.php: code handling public registration to survey
- verfification.php: code handling captcha registration check(image verification to avoid non human regostration)
- load.php: code handling partial survey completion saving
- save.php: code that actually records answers in the database at survey runtime
Admin folder
When accessing the admin GUI the following scripts are used:
- admin.php: main admin script which checks for user rights for the accessed action and reads the 'action' get parameter to call the desired submodule
- login_check.php: security code that checks that the session is authenticated
- access_denied.php: action forbidden screen
The admin section consist of several submodules. To see which one is called the passed 'subaction' value is checked by the "if ($action == ...") statements in admin.php (lines 54-213). A submodule reads the 'subaction' get parameter to process the corresponding part of the code . This submodule writes its output to a variable (for instance $tokenoutput for the tokens.php file) and this variable is then appended by admin.php to the adminoutput
(see admin.php lines 216-274).
Dealing with languages
To translate string the language.php class is used. Translated strings can be added in any part of the admin GUI
code by using the global variable $clang.
Examples:
- For htmlized translation of Yes use $clang->gT("Yes")
- For javascript-escaped translation of Yes use $clang->gT("Yes","js")
- For unescaped translation of Yes use $clang->gT("Yes","unescaped"). This one is used when you want to compare a "translated Get param" that was sent as htmlized string but received as unescaped string