PHPackages                             kaigan/qbankapi2wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. kaigan/qbankapi2wrapper

ActiveLibrary

kaigan/qbankapi2wrapper
=======================

A PHP wrapper for QBank2's API.

v1.3.5(10y ago)2931PHPPHP &gt;=5.3.0

Since Nov 18Pushed 10y ago3 watchersCompare

[ Source](https://github.com/kaigan/qbankapi2wrapper)[ Packagist](https://packagist.org/packages/kaigan/qbankapi2wrapper)[ RSS](/packages/kaigan-qbankapi2wrapper/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

\#QBank - API2 wrapper

Introduction
------------

[](#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
------------

[](#installation)

Install via composer.

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

```

Class library
-------------

[](#class-library)

A class library is available at  or in PDF form upon request.

Usage
-----

[](#usage)

### Instantiation and login

[](#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

[](#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

[](#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

[](#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)

[](#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

[](#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

[](#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

[](#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

[](#the-search-results)

A search returns an object of the type `SearchResult`. This is a container of the `Object`s or `SimpleObject`s 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.

```

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity62

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~127 days

Recently: every ~154 days

Total

6

Last Release

3916d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1144c26666bada21b9d4caa9428f82cfb5c13e1f222f65a0c8a8baaea02c927a?d=identicon)[kaigan](/maintainers/kaigan)

### Embed Badge

![Health badge](/badges/kaigan-qbankapi2wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/kaigan-qbankapi2wrapper/health.svg)](https://phpackages.com/packages/kaigan-qbankapi2wrapper)
```

###  Alternatives

[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k379.4k24](/packages/team-reflex-discord-php)[elgg/elgg

Elgg is an award-winning social networking engine, delivering the building blocks that enable businesses, schools, universities and associations to create their own fully-featured social networks and applications.

1.7k15.7k4](/packages/elgg-elgg)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[drevops/git-artifact

Package artifact from your codebase in CI and push it to a separate git repo.

2133.2k](/packages/drevops-git-artifact)[doppar/framework

The Doppar Framework

366.7k8](/packages/doppar-framework)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
