Download the PHP package themanwiththegoldenhand/lotr-php-sdk without Composer

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

lotr-php-sdk

A Lord of the Rings (LOTR) PHP SDK

This is the PHP SDK for the Lord of the Rings API available at https://the-one-api.dev/v2.

Documentation for the API can be found at https://the-one-api.dev/documentation.

You will need to generate your own unique Access token, which you can obtain from https://the-one-api.dev/sign-up

Installation

You can install the LOTR SDK using Composer.

First, make sure you have Composer installed on your system.

Then, run composer init and composer require themanwiththegoldenhand/lotr-php-sdk.

Alternatively, you can download the LOTR.php file and include it in your project manually.

Usage

To use the LOTR SDK in your project, you first need to create a new instance of the LOTR\LOTR class:

The usage examples in this README assume you have installed the package via Composer.
Make sure to replace YOUR_APIKEY with the Access token, which you can obtain from https://the-one-api.dev/sign-up.

You can then use the client to make requests to the LOTR API. For example, to get a list of all movies:

The $response variable will contain the response from the API, which you can then manipulate as needed.

Further Usage Examples

Get a list of all movies
Request one specific movie
Request all movie quotes for one specific movie
(only working for the LotR trilogy)
Get a list of all movie quotes
Request one specific movie quote
Limiting results
The movies service paginated with up to 2 results per page
Paginating results
The second page of the movies service paginated with up to 2 results per page
Offsetting results
The movies service paginated with up to 2 results per page and offset by 1 result
Note: If the offset is set, setting the page will not be applied
Sorting results
The movies results sorted by descending order of academyAwardWins
Note: Sorting can be applied against any valid key with either an asc or desc direction,
Filtering results (Example 1)
The character results filtered by those who are of Hobbit or Human race, do not have Blonde hair and whose name contains king.
Filtering results (Example 2)
The movies results filtered by those whose revenue was more than 1 billion and which won at least 1 academy award.

Building the filtering argument

The setFilters function accepts a two-dimensional array. Each one of which must contain a value for key and filter_type.

All filter types other than exists and not_exist, must also have a value for value.

The only accepted values for filter_type are match, not_match, include, exclude, exists, not_exist, regex_match, regex_not_match, >, <, >= and <=.

If the filter_type is one of >, <, >= or <=, then the value of value must be numeric. For all other filter_type values, the value for value must be a non-empty string.

Disclaimers

This SDK is NOT a complete implementation. A greater emphasis has being put into the /movie and /quote services.

Testing

To run the unit tests for the LOTR SDK, first make sure you have PHPUnit installed and have added your Access token in the test file (tests/Test.php:8). Then, run the following command from the root directory of the project:

This will run all the tests in the tests directory.

Running all the tests in the project assumes you have cloned the repository.

Contributing

If you find any bugs or have any feature requests, please open an issue on the GitHub repository. Pull requests are also welcome!

License

This SDK is licensed under the Apache-2.0 license. See the LICENSE file for more information.


All versions of lotr-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
ext-curl Version *
ext-json Version *
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 themanwiththegoldenhand/lotr-php-sdk contains the following files

Loading the files please wait ....