Download the PHP package dmgctrlr/lara-osrm without Composer

On this page you can find all versions of the php package dmgctrlr/lara-osrm. 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 lara-osrm

Wrapper around OSRM for Laravel

Build Status Latest Version on Packagist PHP Version Minimum License

This package is a simple wrapper for querying OSRM. It assumes you have an OSRM v5.x server available. It supports route, nearest, table, match, and trip services. Driving is the only profile currently supported.

Installation

You can install the package via composer:

Publish the config file (config/lara-osrm.config)

You can overwrite the defaults in your .env file too:

Usage

Getting the Request Service

There are a few ways to get the request service, depending on your preferences and situation.

Direct Creation

You can create them directly - passing an array (including 'host' and 'port' keys if you want to overwrite reading from config()

Dependency Injection

LaraOSRM registers with Laravel's dependency injector - so if you're using LaraOSRM in a controller, job or similar you can simply add it as a requirement. It will be setup using the config settings defined in config/lara-osrm.php and/or .env

Route Calculation

See: http://project-osrm.org/docs/v5.22.0/api/#route-service

Match Service

See: http://project-osrm.org/docs/v5.22.0/api/#match-service

SendChunk - sending huge RouteServiceRequests

Note: This is an experimental feature, your contributions are welcome

If you want to a route request with more than a few hundred waypoints you'll run into URI length limits when the library sends a GET request to OSRM.

To workaround that you can use sendChunk() - which is an experimental and incomplete attempt at breaking your huge request into smaller requests and combining them.

To use sendChunk():

Known Limitations of sendChunk() (and how to help out)

This is actually a list of things known to (probably) work. The crux of the complexity of sendChunk is in re-combining and stitching together the multiple requests we make.

Ultimately we want to be able to perform a send() and a sendChunk() and get exactly the same result. We can do this by using a test list of Waypoints which is small enough for send() and use really small (e.g. 10 instead of 100) chunk sizes.

The tests are currently all in: RouteServiceTest::testSendChunkReturnsSameAsSend and towards the bottom there are a bunch of commented out asserts. The next step is to make those asserts work, and then declare another bit of the result OK!.

Testing

If you get errors like Failed asserting that 429 matches expected 400. or other mentions of code 429 then the server you're using is probably busy (or rate limiting you).

By default the tests will use the OSRM demo server, to use your own or another server cp phpunit.xml.dist phpunit.xml and edit the environment variables.

If you're getting errors about a route not having a distance, and you're using your own server - check the server is properly configured and is not returning non-zero distances. For these tests you must have the "berlin" area installed.

or (better on Windows):

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.


All versions of lara-osrm with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8
guzzlehttp/guzzle Version ^6.3||^7
illuminate/support Version 5.7.*||^6||^7||^8
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 dmgctrlr/lara-osrm contains the following files

Loading the files please wait ....