Download the PHP package perimeter/rate-limit-bundle without Composer

On this page you can find all versions of the php package perimeter/rate-limit-bundle. 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 rate-limit-bundle

Perimeter RateLimitBundle

Build Status

Built on top of the stand-alone rate limiting library rate-limiter-php

Rate Limit those APIs!

Installation

Get Started

This library helps you rate limit your APIs in two ways:

Configure your Meter Storage

The simplest option is to use MemoryStorage for meter configuration. Be default the warning header is issued at 80 calls/hour, and the response is throttled at 100 calls/hour. You can change these basic defaults in your service container:

This will now warn and limit your users at 45,000 and 50,000 calls per hour respectively. You can also customize different meters depending on the authenticated user:

This means any calls authenticated with the username bshaffer will get warned at 150/hr and limited at 200/hr instead of the default. If you plan on rate limiting by username, the Doctrine Meter Storage is highly recommended.

Doctrine Meter Storage (advanced)

Doctrine meter storage is the best way to configure meters dynamically. First, run the command to create the tables in your database:

php vendor/doctrine/orm/bin/doctrine orm:schema-tool:update --force

Second, you will need to configure your container to use the doctrine storage engine:

Next, you'll want to create the meters in your doctrine database. Do this using the perimeter:rate-limit-meter command, for example:

$ ./bin/console perimeter:rate-limit-meter * 80 100

You must have a default meter configured when using Doctrine Meter Storage. The command above will create default meters which warn at 80 calls/hour, and rate limit at 100 calls/hr.

You can use the perimeter:rate-limit-meter command to view, create, update, and delete meters. There is also a MeterApiController that exposes a JSON/XML API to do this very thing.

Configuring your Throttler

By default, this library uses the RedisThrottler for keeping track of hits and buckets. If Redis is not an option for throttling, you can use DoctrineThrottler for this as well, although this is not recommended as Redis is much better suited for this kind of thing.

Redis Throttler (default)

This library uses Redis by default. To get started with the redis throttler, as long as redis is running on localhost:6379, you don't have to do anything! If your redis server is running somewhere else, just configure perimeter.rate_limit.redis_client.url in your container to point to the proper host and port.

Doctrine Throttler

Be sure to run the following command to create the rate_limit_bucket table in your database:

php vendor/doctrine/orm/bin/doctrine orm:schema-tool:update --force

Now, configure your container to use Perimeter\RateLimiter\Throttler\DoctrineThrottler by making the throttler service ID an alias to the doctrine throttler:


All versions of rate-limit-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
symfony/symfony Version ~2.3
perimeter/rate-limiter-php Version ~0.1
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 perimeter/rate-limit-bundle contains the following files

Loading the files please wait ....