Download the PHP package easybib/api-client-php without Composer

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

PHP Client for EasyBib API

Use this to request data from the EasyBib API. The client uses Guzzle under the hood for the actual HTTP calls.

Installation

This library requires PHP 5.5 or later.

Use Composer to add this project to your project's dependencies.

Your Composer JSON

Once your JSON is set, this will install the package

Usage

Instantiation

Two OAuth grant types are currently supported: JSON Web Token, and Authorization Code.

JSON Web Token Grant

Authorization Code Grant

In order to use an Authorization Code Grant, you will need an implementation of RedirectorInterface from the OAuth2 Client library in order to allow the API client to redirect the user and get back an authorization code. You can find more information at an example in the README for that project.

Retrieving api resources

Once you have an API object, you can use it to traverse the API. The two entry points are $api->getUser() and $api->getProjects().

getUser() will return a ApiResource representing the user; calling getResourceData()->getRelations() on the user api resource will return a set of available references which can be called from the user. So the call chain for a particular project's citations might be

which would return a Collection of citations. Some more examples:

Session backend

By default, the ApiBuilder uses native PHP sessions wrapped by a Symfony session interface. You can implement a different session backend; see the Symfony docs for more information.

Resetting the session

It is possible to reset the token store of the OAuth2 client, such as when a guest user registers or logs in, and needs a new token which will be associated with the permanent user account. In this case, the application consuming the API must instantiate a new ApiTraverser or call setCache(), with a new cache or cache namespace, to ensure that the ApiTraverser will not return api resources cached during the original session.

By default, ApiTraverser uses a PHP-array-based cache, so unless you have implemented a different caching backend, you can simply instantiate a new ApiTraverser, either directly or via the ApiBuilder.


All versions of api-client-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
doctrine/cache Version ~1.3
guzzlehttp/guzzle Version ^6.0
easybiblabs/oauth2-client-php Version ^4.1
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 easybib/api-client-php contains the following files

Loading the files please wait ....