Download the PHP package ggedde/spry-rate-limits without Composer

On this page you can find all versions of the php package ggedde/spry-rate-limits. 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 spry-rate-limits

Spry Rate Limits

This is a Spry Provider for adding Rate Limits to your Routes or a global Rate Limit for all requests

Installation

composer require ggedde/spry-rate-limits

Activation

In order to activate Rate Limits you need to initialze the Provider within your config and set the Rate Limit settings within your Config.

Spry Configuration Example


* By Default Rate Limits are not active, but you can set a global rate limit by adding the default settings to your Spry Config or by adding limits individually to each route.

Add a Global Rate Limit

Adding Limits per route

Global Settings

Setting Type Default Description
driver String '' Driver to use to store the Rate Limit History. Currently only db and file is allowed. db uses SpryDB Provider to store the data so you must have SpryDB configured. In the future we plan to add memcached and redis. When setting the Driver to db you will need to make sure the table exists or you can run spry migrate to add the database automatically.
dbTable String '' When Driver is set to db you must set a Table to store the rate limit history.
dbMeta Array [] When Driver is set to db you can pass meta data to the DB Provider.
fileDirectory String '' When Driver is set to file you will need to pass a directory to store the files used to track the rate limits.
default Array [] Default Global Rate Limit settings.
excludeTests Boolean false Whether to Exclude Tests when checking rate limits. This can be overwritten per route.

Rate Limit Settings

Setting Type Default Description
by String 'ip' Key used to identify the request. By default SpryRateLimits only supports ip. However, you can hook into this field and filter it with your own value. ex. account_id or user_id. See below for more details.
limit Number 0 Number of allowed requests
within Number 0 Time in Seconds to allow.
excludeTests Boolean false Whether to Exclude Tests when checking rate limits. If this is not set then the Global excludeTests setting will be applied.
hook String 'setRoute' When to run this Rate limiit. This uses Spry Hooks See (Spry Lifecycles)

Adding your own Rate Limit (by) Key

The default by key is ip, but many times this is not the best case. So you can add your own keys and values and filter the rate limit to change the value being checked.

Example retriving a value from Srpy's getAuth() method.

Extended Component Example

Using your new key in your Route


All versions of spry-rate-limits with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
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 ggedde/spry-rate-limits contains the following files

Loading the files please wait ....