Download the PHP package 52-entertainment/302 without Composer

On this page you can find all versions of the php package 52-entertainment/302. 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 302

CI Workflow Codecov

302

This is a load balancer that doesn't act as a load balancer.

It is a redirect balancer. Instead of forwarding traffic to a specific host/port, it returns a 302 response with a different location.

Typical usage is that your entrypoint is https://example.com/foo and you want to redirect your traffic to a pool made of https://01.example.com and https://02.example.com, by keeping path and query string intact.

It is built with PHP 8 on top of ReactPHP. Because it answers very short responses and runs within a loop, it can easily handle thousands of requests/s without blinking an eye.

Build

Build is optional (you can simply run php bin/console serve) but will produce an optimized, single-file executable PHAR.

PHP 8, Composer and Box are globally required on your computer.

To build the application, run:

It will land in bin/302.

Usage

Live balancing (no persistence - for testing purposes or prototyping)

Persisted storage (Redis)

App will run, but user agent will get 503 errors because the server pool is empty.

Add a server to the pool

This command can be run while 302 serve is running, no need to restart the app!

Remove a server from the pool

This command can be run while 302 serve command is running, no need to restart the app!

List servers in the pool

Tests

Deployment

Example Supervisor config

After building the app, you can easily create a supervisor recipe to load it on startup:

With the above config, 302 will run on 127.0.0.1:8000, 127.0.0.1:8001, 127.0.0.1:8002 and 127.0.0.1:8003.

Round-robin will be shared across the instances (since they share the same Redis instance).

CORS / SSL termination

302 has no built-in CORS nor SSL termination, but this can be handled by any web server with reverse-proxy capabilities (Apache, Nginx, Caddy, ...).

Caddyfile example

If you're using Caddy, here's an example Caddyfile:


All versions of 302 with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
ext-ctype Version *
ext-iconv Version *
ext-pcntl Version *
ext-redis Version *
bentools/uri-factory Version ^2.2
clue/redis-react Version ^2.4
nyholm/dsn Version ^2.0
react/http Version ^1.2
symfony/console Version 5.2.*
symfony/dotenv Version 5.2.*
symfony/flex Version ^1.3.1
symfony/framework-bundle Version 5.2.*
symfony/yaml Version 5.2.*
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 52-entertainment/302 contains the following files

Loading the files please wait ....