Download the PHP package weble/ptv-php without Composer

On this page you can find all versions of the php package weble/ptv-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 ptv-php

PHP SDK for the PTV APIs

Latest Version run-tests Total Downloads

This is an SDK for the PTV API.

It currently implements partially the Data API and the Routing API.

Under the hood it uses Saloon to handle the requests.

It features only 2 dependencies:

Every parameter and response object is carefully mapped with a dedicated DTO class and Enum

Installation

composer require weble/ptv-php

Basic Usage

Just create the client and interact with each of the apis.

Setting a language

Data Api

Only 3 endpoints are implemented as of today:

1. vehicleProfiles

2. vehicleModels

3. mapInformation

Routing Api

Currently only 3 endpoints are supported:

1. calculate

This is by far the most complete one and the most likely used. You can calculate a route by chaining parameters within the call.

Each parameter is typed for full IDE autocompletion and ease of use.

2. recalculate

Uses a previously returned Route Id to recalculate parts of the route results

Get Route

Get previously calculated route details, or even an alternative route detail.

The route object

The Route object is a fully typed DTO to ease reading the results of the APIs

Testing

To test you can just run

composer test

It will use fixture json to test the SDK.

If you want you can also set a .env file with a dedicated PTV key and do some real testing with the API.


All versions of ptv-php with dependencies

PHP Build Version
Package Version
Requires saloonphp/saloon Version ^3.0
moneyphp/money Version ^4.5
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 weble/ptv-php contains the following files

Loading the files please wait ....