x

Main chapters

  1. LimeSurvey Cloud vs LimeSurvey CE
  2. LimeSurvey Cloud - Quick start guide
  3. LimeSurvey CE - Installation
  4. How to design a good survey (Guide)
  5. Getting started
  6. LimeSurvey configuration
  7. Introduction - Surveys
  8. View survey settings
  9. View survey menu
  10. View survey structure
  11. Introduction - Questions
  12. Introduction - Question Groups
  13. Introduction - Surveys - Management
  14. Survey toolbar options
  15. Multilingual survey
  16. Quick start guide - ExpressionScript
  17. Advanced features
  18. General FAQ
  19. Troubleshooting
  20. Workarounds
  21. License
  22. Version change log
  23. Plugins - Advanced
 Actions

Accessing the source code: Difference between revisions

From LimeSurvey Manual

Admin (talk | contribs)
No edit summary
mNo edit summary
 
(20 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__TOC__
=General=


__TOC__
Until recently we used Subversion as versioning control system but now have [[Switch from Subversion to Git|moved to Git.]]


=Accessing the LimeSurvey v1/v2 Source Code=
=Accessing the LimeSurvey source code=


Always be aware that LimeSurvey Source code is '''bleeding edge'''. Do not use it for production purposes!
Always be aware that most of the LimeSurvey Source code is '''bleeding edge'''. Do not use it for production purposes (except fo the master branch!


As for many other free software projects only community support is available.
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.
Access the LimeSurvey source code with a Subversion client for your operating system.
*For Windows we recommend: [http://tortoisesvn.sourceforge.net/ TortoiseSVN]. TortoiseSVN integrates nicely with explorer and is very easy to use.
*For Windows we recommend: [http://www.syntevo.com/smartgit/download.html SmartGit] because it is very easy to use.
*For Mac we recommend: [http://subversion.tigris.org/project_packages.html subversion]. Commandline all the way ;)
*For Linux & Mac we recommend: [http://git-scm.com/ Git]. Commandline , or use git gui, very easy too.


==Step-by-Step How-To (Windows)==
==Step-by-Step How-To (Windows)==
#Download and install [http://tortoisesvn.sourceforge.net/ TortoiseSVN]. Reboot after install.
# Create a [https://github.com/ GitHub] account.
#Create a destination directory for the source
# Download and install Git for Windows from [http://code.google.com/p/msysgit/downloads/list]. Make sure that during install when asked for adding the Git path to your system path that you choose the "Run Git from the Windows Command Prompt" option. For further help see [http://help.github.com/win-set-up-git/ Set Up Git]
#Change to that directory
# Download and install [http://www.syntevo.com/smartgit/download.html SmartGit].
#Right-click into the directory and choose ''''SVN Checkout''''
# Clone the LimeSurvey repository with SmartGit. You can find the right clone URL at https://github.com/LimeSurvey/LimeSurvey .
#You'll be prompted for the repository URL. Enter the following URL:
# The whole source code repository should be downloading now.
## For LimeSurvey 1.x latest stable source (including fixes): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey
# By default you should see the 'master' branch in the current directory
## For LimeSurvey 1.x latest development source (unstable, including newer features): https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_dev
# Use the Switch command from the SmartGit GUI to switch to the branch you need.
## <nowiki>[deprecated]</nowiki> For LimeSurvey CI source: https://limesurvey.svn.sourceforge.net/svnroot/limesurvey/source/limesurvey_ci
# That's it.
## 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 [http://subversion.tigris.org/project_packages.html 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
# <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.
 
==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:'''
==Step-by-Step How-To (Linux)==
* config.php
* config-ldap.php
* config-defaults.php


'''Survey core files:'''
=== Read-only mode===
* common.php: common functions used in 'survey at runtime' code and in 'admin gui code'
# Install via yum/apt/yahourt/... git and git-core
* ldap-functions.php: common functions for ldap connector (currently only used in import tokens)
# Clone LimeSurvey in ReadOnly mode : <syntaxhighlight lang="bash" >git clone git://github.com/LimeSurvey/LimeSurvey.git</syntaxhighlight>
* qanda.php: functions handling questions (display, ...)
# By default you should see the 'master' branch in the current directory
* question.php: code handling '1 question per page' kind of survey
# To set to dev (Yii branch actually)<syntaxhighlight lang="bash" >cd LimeSurvey
* 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==
git checkout Yii</syntaxhighlight>
# To get the update from LimeSurvey:<syntaxhighlight lang="bash" >cd LimeSurvey


When accessing the admin GUI the following scripts are used:
git pull</syntaxhighlight>
* 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
=== Start your own branch ( Fork )===
# See the complete instrtuction in GitHub : http://help.github.com/fork-a-repo/


(see admin.php lines 216-274).
Please add instructions for other OSs or complete the existing ones.


==Dealing with languages==
=Available branches=


To translate string the language.php class is used. Translated strings can be added in any part of the admin GUI
These are the available GitHub branches right now:
*master - This is always the current stable (plus) version including any fixes not yet released.
*original_art and original_art 2: These are the SVG files for almost all icons the stable and Yii version.
*other_scripts, server_scripts, translation status: These are scripts being used in limesurvey.org or for new releases. We will merge these to a single 'server-scripts' branch soon.


code by using the global variable $clang.
=Further documentation=


Examples:
Please make sure you code accoding to our [[Coding guidelines]].
* 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

Latest revision as of 14:55, 16 February 2022

General

Until recently we used Subversion as versioning control system but now have moved to Git.

Accessing the LimeSurvey source code

Always be aware that most of the LimeSurvey Source code is bleeding edge. Do not use it for production purposes (except fo the master branch!

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: SmartGit because it is very easy to use.
  • For Linux & Mac we recommend: Git. Commandline , or use git gui, very easy too.

Step-by-Step How-To (Windows)

  1. Create a GitHub account.
  2. Download and install Git for Windows from [1]. Make sure that during install when asked for adding the Git path to your system path that you choose the "Run Git from the Windows Command Prompt" option. For further help see Set Up Git
  3. Download and install SmartGit.
  4. Clone the LimeSurvey repository with SmartGit. You can find the right clone URL at https://github.com/LimeSurvey/LimeSurvey .
  5. The whole source code repository should be downloading now.
  6. By default you should see the 'master' branch in the current directory
  7. Use the Switch command from the SmartGit GUI to switch to the branch you need.
  8. That's it.

Step-by-Step How-To (Linux)

Read-only mode

  1. Install via yum/apt/yahourt/... git and git-core
  2. Clone LimeSurvey in ReadOnly mode :
    git clone git://github.com/LimeSurvey/LimeSurvey.git
    
  3. By default you should see the 'master' branch in the current directory
  4. To set to dev (Yii branch actually)
    cd LimeSurvey
    
    git checkout Yii
    
  5. To get the update from LimeSurvey:
    cd LimeSurvey
    
    git pull
    

Start your own branch ( Fork )

  1. See the complete instrtuction in GitHub : http://help.github.com/fork-a-repo/

Please add instructions for other OSs or complete the existing ones.

Available branches

These are the available GitHub branches right now:

  • master - This is always the current stable (plus) version including any fixes not yet released.
  • original_art and original_art 2: These are the SVG files for almost all icons the stable and Yii version.
  • other_scripts, server_scripts, translation status: These are scripts being used in limesurvey.org or for new releases. We will merge these to a single 'server-scripts' branch soon.

Further documentation

Please make sure you code accoding to our Coding guidelines.