Download the PHP package bgsu-lits/libcal without Composer

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

libcal

PHP client library for the Springshare LibCal API.

Getting Started

You may want to begin by reviewing the Overview of the LibCal API from the Springshare Help Center. This client uses the API v1.1 endpoints.

This package is developed for PHP 7.4 and above. You should use Composer to install this package and its dependencies. For example:

Required Dependencies

PSR-18 HTTP Client

The client requires an implementation of psr/http-client. This documentation will use guzzlephp/guzzle for examples, but any implementation may be used instead.

PSR-17 HTTP Factories

The client requires an implementation of psr/http-factory. This documentation will use guzzlephp/psr7 for examples, but any implementation may be used instead.

PSR-7 HTTP Message Interface

The client requires an implementation of psr/http-message. This documentation will use guzzlephp/psr7 for examples, but any implementation may be used instead.

Optional Dependencies

PSR-16 Simple Cache

The client can use an implementation of psr/simple-cache. This documentation will use desarrolla2/cache for examples, but any implementation may be used instead.

Determining Client Credentials

Host

The host for the client will be the hostname of your LibCal instance, i.e. <institution>.libcal.com. For examples, we'll use BGSU's host of bgsu.libcal.com.

Client ID and Secret

Visit the Dashboard of your LibCal instance, and navigate to Admin > API. Choose the API Authentication tab, and use the Create New Application button under the Applications section. You may specify any Application Name and Description you prefer and leave checked any of the scopes you want to access with the client.

Once you've created the application, you will need to copy the values from the Client Id and Client Secret columns of the Applications table. For examples, we'll use a Client ID of 100 and a Client Secret of 61483dcf150d97c921abbe1f8024eb2e.

Instantiating the API Client

Now that you've gathered the dependencies and credentials, you can instantiate the API client. Below is an example PHP file that will include Composer's autoloader and create the API client with credentials and dependencies. This is using the examples we've specified above, with comments showing the interfaces the dependencies must implement.

Using the API Client

With an instantiated API Client, you can access API endpoints in a fluid fashion. For example, to access the /space/locations endpoint, you can do the following:

Parameters can also be added, typically through methods beginning with set. For example, the /space/locations endpoint has both details and admin_only as parameters:

Some endpoints require parameters to be specified, typically IDs. For example, to access /space/item/:id with an ID of 100:

The resulting data from API calls will be mapped to a PHP object or array of objects of class Lits\LibCal\Data. In turn, the properties should be accessible from those objects in the correct format.

If the endpoint requires data to POST, that data is specified in a specific payload object. These objects can be created from POST data submitted by the user. For example, to use the /space/reserve endpoint to reserve a space:

Caching Results

Providing a Simple Cache client to the API client is optional. If it is provided, it will always be used to cache authenticated sessions. It then can also be used to cache the results of most GET endpoints. This can be accomplished by calling the cache() method on those endpoints before send():

It is recommended to consult your Simple Cache client's documentation on how to best set up the cache to preserve entries between processes.

Limitations

This client currently only implements the Spaces/Seats endpoints under /space.

Related Projects

An application that provides a public interface for space booking using this library is also available from the BGSU University Libraries.

The IUPUI University Library provides an example LibCal Room Reservation Application that includes their own implementation of a client.

Development

This client was developed by the Library Information Technology Services of the University Libraries at Bowling Green Sate University. The code is licensed under the GitHub Project.

Contributions are also welcome, preferably via pull requests. Before submitting changes, please run test command via Composer (php composer.phar test) to check that code conforms to the project standards.


All versions of libcal with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 | ^8.0
ext-date Version *
ext-pcre Version *
netresearch/jsonmapper Version ^4.0
psr/http-client Version ^1.0
psr/http-client-implementation Version *
psr/http-factory Version ^1.0
psr/http-factory-implementation Version *
psr/http-message Version ^1.0
psr/http-message-implementation Version *
psr/simple-cache Version ^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 bgsu-lits/libcal contains the following files

Loading the files please wait ....