Download the PHP package nodeone/qbank3api-phpwrapper without Composer

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

QBank 3 API PHP Wrapper

Latest Stable Version Latest Unstable Version License

Introduction

QBank 3 API PHP Wrapper is a library that makes it easy to use the QBank 3 API directly from PHP. No need to handle the connections or interpreting the results yourself.

Installation

Install via composer.

{
    "require": {
        "qbnk/qbank3api-phpwrapper": "dev-master"
    }
}

Usage

This documentation presumes that you have a firm grasp of the concepts in QBank. If you do not or perhaps want a reference to lean on, please read the articles in the Knowledge Base for QBank. The Knowledge Base is found at: support.qbank.se

Instantiate the wrapper by creating a new QBankApi. The QBankApi class constructor takes three arguments of which two are required. The first is the URL to the api of the QBank you want to connect to. If the QBank is hosted by QBNK the domain of the QBank is sufficient; otherwise the full URL to the API endpoint is needed.

The second argument is a Credentials object which contains all necessary information to authenticate against QBank. These are as follows:

To get a client id issued, please contact us at [email protected]

Searching

Searching is essential to find Media in QBank. Usually one would have at least some criteria for listing Media but even when wanting to display everything searching is the way to go. To find every Media in QBank you would execute a search with no parameters. With no filtering options set, the search would match everything just like the * wildcard in the terminal or similar.

But why did we only get 50 results when our QBank contains thousands of Media? The simple answer is that searches are paginated to not flood you with data and return to you in a reasonable amount of time. The default page size is 50. It is pretty simple to get several pages of results with the number of results of your choosing in each.

The results of an executed Search is a SearchResult object. This is merely a wrapper class around an array of Media objects, but with some extra information tacked on. One of these are the very useful getTotalHits() method. With it you can search with a reasonable limit and still print out the number of total results. You can then write code to fetch more results when needed.

SearchResult also implements Iterator so that you can loop over it just as a regular array. This makes it easy to display your results.

Searching with criteria

Usually we have some default criteria such as Media belonging to specific Category or maybe deployed to a specific site. This is easily done by adding criteria to the Search object.

You may also want to filter on a Property. This is done by adding a PropertyCriteria to your search object. This will however not get those set in the SearchResult. To get Property values for Media in a SearchResult a PropertyRequest has to be added to the Searchobject.

There are many more possibilities to filter your searching by and this has just been a demonstration of some of the most used ones. Browse through the setters in the Search class and it should be pretty obvious what is possible.

Events

Events are calls that are made to report back to QBank that something has happened worthy of statistics collection, an event. Statistics for events are shown in QBank.

To be able to report an event a session id must be obtained. The session id identifies the acting user over a period of time. To obtain a session id, a session source must be provided. The session source identifies the source of the event (eg. frontend, api, app). To get a session source issued, contact [email protected].

To report custom events (the ones not covered by the methods available), just use the custom() method. These will be displayed in the statistics alongside the other.

It is also possible to report external usage eg. from a CMS or other. This is not shown in the statistics, but in the media detail in QBank. This provides a good overview of where a media is used. Of course you can also remove the usage report if it is no longer in use. See the methods addUsage() and removeUsage() respectively.


All versions of qbank3api-phpwrapper with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
qbnk/guzzle5-oauth2-subscriber Version ~0.1.4
doctrine/cache Version ~1.3
psr/log Version 1.0.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 nodeone/qbank3api-phpwrapper contains the following files

Loading the files please wait ....