Download the PHP package kaigan/qbankapi2wrapper without Composer

On this page you can find all versions of the php package kaigan/qbankapi2wrapper. 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 qbankapi2wrapper

QBank - API2 wrapper

Introduction

QBankAPI2Wrapper is a library that makes it easy to use the QBank API2 directly from PHP. No need to handle the connections or interpreting the results yourself. QBankAPI2Wrapper also provides classes with metods for the most commonly used functions.

Installation

Install via composer.

"require": {
    "kaigan/qbankapi2wrapper": "~1.3"
}

Class library

A class library is available at http://tools.kaigantbk.se/docs/docs/QBankAPI2Wrapper/ or in PDF form upon request.

Usage

Instantiation and login

There are many classes in QBankAPI2Wrapper, but it is quite easy to find the ones that does the calls to QBanks API2. They are named by the convention "QBank_Functionality_API", where Functionality tells what kind of functions the class contains. There are also one class named QBankAPI. It is an abstract base class and can therefore not be instantiated.

To instantiate an API-class it is easiest to use the "QBankAPIFactory" class. After it has been set up. It can instantiate all the other API-classes ready to go.

Please note that this will call session_start() and store a value in $_SESSION.

The manual way

If you want to handle the logins and instantiation of the API-classes yourself it is of course possible to do that.

If there is a need to instantiate several API-classes (there often is), please refrain from logging in when instantiating every class. The best practice is to log in the first time and the recycle the session hash. A log in should only be needed one time per user session.

Logging

QBankAPI2Wrapper utilizes Monolog and has a default Monolog\Handler\ErrorLogHandler to allow you to see most messages in your default error log for PHP. If needed you may push other handlers via the BaseAPI->addLogHandler() method.

Search

Searching is the primary way to retrive more then one object from QBank. There are several ways to conduct a search, and the preffered way to do it depends on the cirumstances.

A search is done by creating a search object. Please note that this class is only available after instantiating the Search-API. It is then possible to customize the search to suit your needs. After the search object is set up, supply it to QBankSearchAPI::execute().

Retrieving properties (metadata)

QBank stores properties for every object that the user can set themselves. These are not included in the result by default, but has to be requested.

The bad way

An intuitive but bad way to conduct a search is to do a search and then iterate over the results and call QBankObjectAPI::getObject() for each result. This will return all information about these objects, but will generate alot of network traffic and overhead. Avoid this!

The better way

To achieve the same result as in the bad way without causing a traffic jam on the network the Search::setAdvancedObjects() can be set to true. This will batch all the calls together.

The smarter way

If there is only some properties that should be returned with the result, the class PropertyRequest should be used.

Please note that this way will produce less information than the previous ones. One change is that a property's default value will be missing. Normally this is ok, but consider what you need and search accordingly.

The search results

A search returns an object of the type SearchResult. This is a container of the Objects or SimpleObjects that a search will return. It would not be incorrect to see SearchResult as an array. It is possible to iterate over and access SearchResult as an array.


All versions of qbankapi2wrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
monolog/monolog Version ~1.7
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 kaigan/qbankapi2wrapper contains the following files

Loading the files please wait ....