Download the PHP package darkorsa/cordo-gateway without Composer

On this page you can find all versions of the php package darkorsa/cordo-gateway. 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 cordo-gateway

cordo-gateway

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

Cordo API Gateway - protection, caching, analytics & monitoring.

What is it? What is it for?

An API gateway is an API management tool that acts as reverse proxy and is located between a client and a backend service (or collection of services).

Most common use cases:

Requirements

Install

First make sure that you have Redis expansions installed. To check it run:

If any of them is missing you can install it from PECL repository:

Create your new project folder and within this folder type:

Then copy .env_example file and rename it to .env and complete it with your configuration data.

Usage

Api Key

First set your API_KEY in .env file, that will extort sending X-Api-Key header with API_KEY value on each request to the gateway.

This can disabled by commenting ApiKeyMiddleware middleware in public/index.php.

Note that X-Api-Key can be also used by rate limiting function.

Defining routes

Since the API gateway is a proxy for the target API you will need to register routes for handling the upcoming requests. This can be done in public/index.php:

Place you routes class somewhere in app/ folder.

Example of routes class:

In the above example there are definitions of two endpoints. One for fetching users data (GET) and second for adding a new user (POST).

CacheRequest method will call target API and cache the result in memory (Redis) for the set amount of time. In this example for 1 hour (3600 seconds). Until cache invalidates no request will be made to the target API.

SendRequest method will simple call target API with all the query & form params as in the original request.

Rate Limiting

You can limit requests that can be made to you API in given amount of time in order to prevent from request flooding / API scraping. For that set appropriate config settings in config/los_rate_limit.php file.

Rate limiting config settings are explained here.

Still to come

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 cordo-gateway with dependencies

PHP Build Version
Package Version
Requires ext-redis Version ^5.0
cache/doctrine-adapter Version ^1.0
filp/whoops Version ^2.3
guzzlehttp/guzzle Version ^7.0
guzzlehttp/psr7 Version ^1.7
hassankhan/config Version ^2.0
http-interop/http-factory-guzzle Version ^1.0
laminas/laminas-mail Version ^2.10
los/los-rate-limit Version ^3.1
middlewares/client-ip Version ^2.0
middlewares/filesystem Version ^2.0
middlewares/image-manipulation Version ^2.0
monolog/monolog Version ^2.1
myclabs/php-enum Version ^1.7
nikic/fast-route Version ^1.3
php-di/php-di Version ^6.2
php-http/cache-plugin Version ^1.7
php-http/curl-client Version ^2.1
php-http/discovery Version ^1.7
psr/http-server-middleware Version ^1.0
relay/relay Version ^2.1
rollbar/rollbar Version ^2.1
symfony/dotenv Version ^5.0
tuupola/cors-middleware Version ^1.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 darkorsa/cordo-gateway contains the following files

Loading the files please wait ....