Download the PHP package hamburgscleanest/laravel-guzzle-throttle without Composer

On this page you can find all versions of the php package hamburgscleanest/laravel-guzzle-throttle. 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 laravel-guzzle-throttle

hamburgscleanest/laravel-guzzle-throttle

Latest Version on Packagist Build Status Coverage Status Quality Score Total Downloads

A Laravel (>= 8.0) wrapper for Guzzle Advanced Throttle.

Install

Via Composer


Automatic Package Discovery

Everything is automatically registered for you.


Configuration

Publish the config to get the example configuration.


Example configuration

20 requests every 1 seconds

100 requests every 2 minutes



Usage

To use the pre-configured client, you have to instantiate your client like this:

After that, you can use all of the usual GuzzleHttp\Client methods, e.g.

Add other middlewares

You can still add other middlewares to the stack, too.
Define your stack as usual and then pass it to the throttled client:

The client will 'automatically' add every other middleware to the top of the stack.


Caching


Beforehand

Responses with an error status code 4xx or 5xx are not cached (even with force-cache enabled)! Note: Also, 3xx redirect codes are not cached.


Supported drivers

The following drivers are officially supported: File, Redis and Memcached.

The configuration for the drivers can be seen in the middleware repository.


Options

Without caching - no-cache

Just throttle the requests and don't cache them. When the limit is exceeded, a 429 - Too Many Requests exception is thrown.


With caching (default) - cache

Use cached responses when your defined rate limit is exceeded. The middleware tries to fall back to a cached response before throwing a 429 - Too Many Requests exception.


With forced caching - force-cache

Always uses the cached responses when available to spare your rate limits. It only sends the request when it is not cached. If there is no cached response and the request limits are exceeded, it falls back to throwing a 429 - Too Many Requests exception.


Wildcards

If you want to define the same rules for multiple different hosts, you can use wildcards. A possible use case can be subdomains:

This host matches https://www.en.mysite.com, https://www.de.mysite.com, https://www.fr.mysite.com, etc.


Further details

If you want to know more about the possible configurations, head over to the middleware repository: Guzzle Advanced Throttle.


Changes

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT 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.


All versions of laravel-guzzle-throttle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
hamburgscleanest/guzzle-advanced-throttle Version ^5.0.1
illuminate/support Version ^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 hamburgscleanest/laravel-guzzle-throttle contains the following files

Loading the files please wait ....