Download the PHP package rocketman/spoa-php without Composer

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

spoa-php

A lightweight PHP framework for building HAProxy Stream Processing Offload Agent (SPOA) services

This library implements the SPOE protocol and allows PHP applications to receive messages from HAProxy, process request or session metadata, and return variables back to HAProxy for use in ACLs and routing decisions.

Latest Version CI License


Features


Requirements


Installation

Install via Composer:

Dependencies

Runtime

Development


Core Concepts

The Connection class

The central abstraction in this framework is SPOA\Server\Connection.

Each incoming SPOE connection from HAProxy is represented by a Connection instance. Applications register message handlers on the connection and return variables (or Promises that resolve to variables) to HAProxy in response.

The framework handles:

Your application code only needs to define handlers.


Registering message handlers

Handlers are registered by message name:


Returning variables to HAProxy

Handlers return an associative array of variables to set or unset.

Alternatively, a handler may return a React\Promise\PromiseInterface that resolves to the associative array. This allows handlers to perform asynchronous operations before returning data to HAProxy.

Variable scopes

Variable names may be prefixed with a scope:

Prefix Scope
proc. Process
sess. Session
txn. Transaction
req. Request
res. Response

If no prefix is provided, the variable defaults to process scope.

Specifying null as a value will unset the variable. To set a variable to null, use Arg::null().


Getting Started

Below is a minimal SPOA agent implemented using this library. The example is intentionally procedural to focus on the framework’s programming model.

Minimal PHP agent

This example:

The application runs inside a standard ReactPHP event loop.


HAProxy Configuration

SPOE configuration (spoe-test.cfg)


HAProxy configuration excerpt

This configuration:


Real-world example

A complete, working SPOA agent built using this library can be found in the Zookeeper Online music database and charting application.

In particular, see:

This example shows how the library can be embedded into a larger application, including integration with an existing ReactPHP event loop and non-trivial decision logic.


Testing

Run the test suite:

Static analysis:

Both are executed automatically via GitHub Actions on push.


License

MIT License. See LICENSE for details.


All versions of spoa-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
react/socket Version ^1.16
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 rocketman/spoa-php contains the following files

Loading the files please wait ...