Download the PHP package meritoo/limesurvey-api-client without Composer

On this page you can find all versions of the php package meritoo/limesurvey-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package limesurvey-api-client

Meritoo LimeSurvey API Client

Client of the LimeSurvey's API.

Travis Packagist StyleCI license GitHub commits Coverage Status

Installation

Run Composer to install this package in your project:

How to install Composer: https://getcomposer.org/download

Configuration of LimeSurvey

  1. Login to the LimeSurvey administration, e.g. using https://your-domain/admin address
  2. Go to menu: Configuration -> Global settings
  3. Open Interfaces tab
  4. For RPC interface enabled select JSON-RPC option
  5. Enable Publish API on /admin/remotecontrol option

It should look like here: Configuration of LimeSurvey More information: https://manual.limesurvey.org/RemoteControl_2_API#Introduction

Usage

  1. First of all you have to prepare configuration of connection and create instance of a client:

  2. Next run the method which you would like:

  3. Finally grab data from result of called method:

Full code of this example:

Available methods

All available methods provides Meritoo\LimeSurvey\ApiClient\Type\MethodType class as constants of the class. Examples:

Name of the method, actually constant of the MethodType class, you should pass as 1st argument of \Meritoo\LimeSurvey\ApiClient\Client\Client::run() method. Example:

Debug mode

In some cases more information may be required to fix bugs. The "debug" mode will help you do this. You can turn it on while preparing configuration of connection by passing true as 4th argument of constructor:

The "debug" mode can be turned on if the instance of configuration exists by using the \Meritoo\LimeSurvey\ApiClient\Configuration\ConnectionConfiguration::setDebugMode() method:

If you want to verify if if the "debug" mode is turned on simply call the \Meritoo\LimeSurvey\ApiClient\Configuration\ConnectionConfiguration::isDebugModeOn() method:

Getting data from result

Verify if the result is empty

First of all you have to call required method to get result - instance of \Meritoo\LimeSurvey\ApiClient\Result\Result class. The result allows you to get information if there is any data by calling the \Meritoo\LimeSurvey\ApiClient\Result\Result::isEmpty() method:

Prepared/processed vs raw data

Result allows you to get data, the essence of calling API's method by calling the \Meritoo\LimeSurvey\ApiClient\Result\Result::getData() method. This method accepts 1 bool argument:

Prepared/processed data means instances of classes from Meritoo\LimeSurvey\ApiClient\Result\Item\* namespace.

Attention.

  1. The above is true, if result provided by the API is iterable. Otherwise - instance of single item is returned.
  2. Methods that provides iterable result:

    • MethodType::LIST_PARTICIPANTS
    • MethodType::LIST_QUESTIONS
    • MethodType::LIST_SURVEYS
    • MethodType::LIST_USERS

    They are defined in Meritoo\LimeSurvey\ApiClient\Type\MethodType::isResultIterable() method.

Prepared/processed data

All instances are returned as elements of collection (instance of Meritoo\Common\Collection\Collection class). Example:

If result provided by the API is not iterable, as mentioned above, instance of single item is returned. Example:

Raw data

An array with scalars or other arrays. Example:

Links

Enjoy!


All versions of limesurvey-api-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
fguillot/json-rpc Version ^1.2
meritoo/common-library Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package meritoo/limesurvey-api-client contains the following files

Loading the files please wait ....